Kaseya Community

Agent Procedure Statement Character limits?

This question is not answered

I'm working on an Agent Procedure, and I'm running into an issue whenever I try to execute a file - no matter how I try to execute it.  I see this error in the AP logs:

FAILED to load the THEN steps for HP Trial-0002(ID = 959980247).Error: Invalid script variable syntax or bad command parameter (step 6)

Line 6 is an IF (testFile) statement that was working before, but I also recognize that Step != Line, so I'm not really sure how to read that...  I'm pretty sure the line causing the issue is the actual file execution, as everything worked fine until I added it.  I've tried using executeFile & executeShellCommand.  The command to install has a lot of cli switches, so I'm wondering if the issue here is a character limit (which I cannot find listed anywhere).  But, for reference, the statements look like this:

executeFile("C:\SWSetup\SP101503\HPImageAssistant.exe", "/Operation:Analyze /Category:All /selection:All /Action:Install /InstallType:AutoInstallable /Silent /BIOSPwdFile:C:\SWSetup\SoftPaqs\BIOSpwd.bin  /ResultFilePath:C:\SWSetup\SoftPaqs\Readme.html /SoftpaqDownloadFolder:C:\SWSetup\SoftPaqs", "Execute as System and Wait", "All Windows Operating Systems", "Halt on Fail")

executeShellCommand("C:\SWSetup\SP101503\HPImageAssistant.exe /Operation:Analyze /Category:All /selection:All /Action:Install /InstallType:AutoInstallable /Silent /BIOSPwdFile:C:\SWSetup\SoftPaqs\BIOSpwd.bin  /ResultFilePath:C:\SWSetup\SoftPaqs\Readme.html /SoftpaqDownloadFolder:C:\SWSetup\SoftPaqs", "Execute as System and Wait", "All Windows Operating Systems", "Halt on Fail")

I've also run the command from a cmd prompt, and it works just fine - so I'm not sure why Kaseya is struggling with it...



All Replies
  • something else to make this even more strange - it works if I break the AP into 2 parts.  part 1 installs the HPImageAssist.exe, and part 2 run it.  Not sure why this would be the case, but I'll have to do some more testing.  maybe the issue isn't the characters, but it's very odd to me that the AP fails out almost immediately as soon as it hits the IF loop where this statement lives...

  • I've noticed some apparent issues with commands that have two sets of quoted statements ("")

    Haven't gotten to the bottom of it, but worked around the issue by created a bat file or PowerShell script to run the commands - copying it locally and executing it.