nas Auto Operator Profile will not run a command

book

Article ID: 35029

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

I have created a script that I can run manually, but when I put the script into an AutoOperator profile with a Action = command, the script will not run. 

My script is a .bat file and only contains one command.  Here is a copy of the command:

    dir >> worked.txt

 

UIM 8.x or higher

Environment

Release:
Component: CAUIM 8.x or higher

Resolution

The are several factors at work here.

1.  When you try to run any command using an AO (autooperator profile) you are running the command in the context of the robot.  With a normal Nimsoft installation this will be the context of the 'Local System Account.'  The Local System Account may not have all of the same rights that are assigned to you.  Also it may not have the same environmental variables defined. You need to make sure that the Local System Account has the rights to run the command you want to run. Otherwise check out this link to overcome any permissions issue:

http://technet.microsoft.com/en-us/library/cc771525(v=ws.10).aspx

2. You need to use full paths when creating output when running a command.  For instance, notepad.exe might work from your command window, but that needs to be c:\Windows\System32\notepad.exe when running as an AO command.  The same thing goes for the output.  

dir >> worked.txt

will place the worked.txt file into the working directory of the command.  Much better is:

dir >> c:\output\worked.txt 

3.  When developing the script try to use output commands to trace the execution:
 
echo starting > c:\output\log.out 
dir d:\ftp >> c:\output\log.out 
echo finished >> c:\output\log.out 

Using this command sequence will always output starting and finished.  If the dir or other command does not generate any output you know it is probably a permissions issue.