Still exit code 1 on script execute command CMD

Hello Everyone

I am experiencing issues with writing a script to execute batch and MSI files simultaneously. Here is the command line to run both in the same command prompt line:

“windows_silent_install.bat agent-client-collector-3.0.0-windows-x64.msi key pointingserver”

I have already tried running the BigFix command by typing:

waithidden cmd.exe /C “windows_silent_install.bat agent-client-collector-3.0.0-windows-x64.msi key pointingserver”

However, the script gives a “completed” status with exit code 1. Can someone help me solve this script writing issue?

Best Regards,
Khoirur

It may be just because you have ommited it for the purpose of the post however it looks like you are missing the path to the .bat file in your command.

Could you please write the example script for this batch file?

Assuming that the batch file is already on the server and that the msi is in the same folder…

action uses wow64 redirection false

waithidden cmd.exe /C "c:\tmp\windows_silent_install.bat c:\tmp\agent-client-collector-3.0.0-windows-x64.msi key pointingserver"

You also had smart quotes in you actionscript which wont work :slight_smile:

I have done to create this script like this and it works the success status completed, but the services still not installed. Roughly, what factors might be causing it to not be installed?

folder create "C:\servicenow"
copy “__Download\installerservicenow.7z” "C:\servicenow\installerservicenow.7z"
delete "__Download\installerservicenow.7z"
waithidden cmd.exe /C “C:\Program Files\7-Zip\7z.exe” e -y C:\servicenow\installerservicenow.7z -oC:\servicenow

delete __appendfile
appendfile @echo off
appendfile cd C:\servicenow
appendfile windows_silent_install.bat agent-client-collector-3.0.0-windows-x64.msi b7ed5c681b32b4108bfb2f40ab4bcbd2 wss://10.186.224.166:443/ws/events
delete runservicenow.bat
copy __appendfile runservicenow.bat
run runservicenow.bat

Have a look at Running a command at the command line for the syntax to save CMD output to a text file so you can read the error messages after. You may need to disable 32-bit redirection as well.

Hi Jason,

Where should I put the command to view the error log?

You could browse to it and open it with Notepad

Or use the Query app in WebUI to read the file through relevance…

lines of file “c:\path\filename.txt”

can i write command to look error log after command “run”.
like this
run runservicenow.bat " /set {{current} nx OptOut > c:\log.txt 2>&1"

No, you’d either need to log on to the client and open the log file, or remotely read the log file with the Query app.

im so sorry i can’t understand what you mean to see log on the endpoint. Do you mean the Bigfix Client log or do I need to provide a separate command line in my script to generate a log output in .txt format?. Can you give me an example on my script

Ah, I wrote a whole post specifically for this, and then forgot to link it back here … Have a look at Tip: Running Commands and Saving Output (Windows) and let me know if that’s helpful

I have done to see your post and perhaps what you mean is to add a log script, is it like this?
folder create "C:\servicenow"
copy “__Download\installerservicenow.7z” "C:\servicenow\installerservicenow.7z"
delete "__Download\installerservicenow.7z"
waithidden cmd.exe /C “C:\Program Files\7-Zip\7z.exe” e -y C:\servicenow\installerservicenow.7z -oC:\servicenow

delete __appendfile
appendfile @echo off
appendfile cd C:\servicenow
appendfile windows_silent_install.bat agent-client-collector-3.0.0-windows-x64.msi b7ed5c681b32b4108bfb2f40ab4bcbd2 wss://10.186.224.166:443/ws/events
delete runservicenow.bat
copy __appendfile runservicenow.bat

action uses wow64 redirection false

waithidden cmd.exe /c “runservicenow.bat > “C:\LogScriptOutput.txt” 2>&1”

Yes, that’s it…give a try