Unsolved
This post is more than 5 years old
4 Posts
0
372
March 1st, 2010 09:00
Creating Windows Remote Commands
I have found creating Windows Remote Commands very difficult, because there is no logging and no way (that I can tell) to discover what the error is when a command fails to function as expected. Has anyone found a way to capture error data during Remote Command testing?
For example, I'm trying to create a Remote Command that does an unattended installation of the Sun Java update. This command works perfectly from the commandline: "C:\Users\pauls.CAMPUS\AppData\LocalLow\Sun\Java\jre1.6.0_18>jxpiinstall.exe /s /v" /qn[ADDLOCAL=ALL][IEXPLORER=1][MOZILLA=1][REBOOT=Suppress][JAVAUPDATE=1][EULA=1]"
When trying to translate that to a remote command, the double quote in the middle becomes a pesky varmint. I tried replace it with chr(34), but that didn't work. What's really frustrating is that the remote command runs, the agent wakes up but nothing happens and no errors are generated to give me a clue what the problem might be.
Any tips or tricks on creating and troubleshooting Windows Remote Commands would be most appreciated.
Eric Chipko
1 Message
0
May 6th, 2010 10:00
EcmEventLog is documented in the help but I have tried to do much with it.
For your specific issue with quotes I eventually got this to work
Lots of double quoting.
strParser = EcmAgtContext.GetHelperAppFile("parsemif.clsparse")
strCommand = "cscript /nologo " & EcmAgtContext.JobDownloadDirectory & "\csv2mif.vbs /utility:""schtasks.exe"" /UtilParms:""/query /v /fo csv"" /ComponentName:""Scheduled Tasks 2003"" /GroupName:""Scheduled Tasks"" /GroupClass:""Task"" "
EcmScriptRuntime.CmdExecute strCommand & " > " & chr(34) & strParser & chr(34) & " 2>&1", 120