Run .cmd from action script not working

Looks like a problem inside the start Windows service.cmd script. I suspect it could be related to this line in it

Set MyCurDir=%CD%

Not handling spaces or parenthesis in the working directory path for C:\Program Files (x86)\BigFix Enterprise\...

So, when you ran this manually, did you first ‘cd’ into the \ibm\install directory? That may be the difference.

You may want to use a small ‘createfile’ to first CD into the script’s directory and then run it…

delete __createfile
createfile until EOF
cd /d "D:\ibm\si\install\bin"
startWindowsService.cmd
EOF

delete wrapper.cmd
move __createfile wrapper.cmd

action uses wow64 redirection false

waithidden cmd.exe /c ""wrapper.cmd" > "D:\ibm\logfile.txt" 2>&1"

continue if {exit code of action = 0
2 Likes

Run locally, I could do it either way, cd in or not and it’d work.
I had my hunch from the beginning that there was something specific to this cmd file that was causing the problem but had no idea how to determine what it was.

Your last recommendation solved the problem here and my appreciation for this cannot be communicated properly here :slight_smile:

Thank you very very much for your patience and help with this…

1 Like

Glad I was able to help!

Might not be so much a problem of ‘must be in that working directory to run the script’, so much as ‘working directory chokes on parentheses in Program Files (x86)’

2 Likes