I’m trying to run a .bat file to install SNMP on W2K3 servers. I am able to copy the files and change the registry settings to point to a file share to copy down needed files.
The relevance that I am using to run the bat file is
Runhidden “{pathname of system folder & “\cmd.exe”}” /Q /C cmd.exe /c “{pathname of parent folder of parent folder of system folder & “SNMP.bat”}”
It will probably just be a matter of formatting. The first thing I see is the last part of your relevance evaluates to:
q: pathname of parent folder of parent folder of system folder & “SNMP.BAT”
A: C:SNMP.BAT
T: 0.237 ms
I: singular string
It is missing the “/” after “C:”
So it should be:
q: pathname of parent folder of parent folder of system folder & “SNMP.BAT”
A: C:SNMP.BAT
T: 0.237 ms
I: singular string
The next thing you might try to do is capture the batch file to see if it will run locally. Add a line that copies the batch file locally so you can look in it and attempt to execute it.
Next thing I might do is see exactly how my my line is getting interpreted to make sure it can execute. For instance you might add the following line:
//capture the line to execute
appendfile “{pathname of system folder & “\cmd.exe”}” /Q /C cmd.exe /c “{pathname of parent folder of parent folder of system folder & “SNMP.bat”}”
move __appendfile “c:\temp.txt”
Now you can see how your relevance was interpreted in “c:\temp.txt”
Occasionally you will want to capture the sdout and stderr of a command. For instance:
You mention that you are trying to copy the files from a Share. You will need to ensure that it is an Anonymous Share. The Agent runs as Local System, and as such has no Network Identity of its own and putting credentials into an Action script is not advisable since the text of the Fixlet/task is stored on every computer with an agent subscribed to the site… You would be better to store the files on an http server and download them from there.