VBS script failing on x64 windows

(imported topic written by tigger0191)

I have a vbs script that works fine on 32 bit Windows 2003, but does not work on x64. I’ve tried a few things like

wait “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}”

wait “{pathname of system wow64 folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}”

and

action uses wow64 redirection false

wait cmd.exe /C “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}”

action uses wow64 redirection true

All of these produce the log file line below (or similar command succeeded notice) but the work doesn’t actually happen.

Command succeeded (Exit Code=1) wait cmd.exe /C “C:\WINDOWS\system32\cscript.exe” "C:\Program Files (x86)\BigFix Enterprise\BES

Again, the first wait action command above works fine on a 32 bit server. Any insight would be welcome. Thanks.

(imported comment written by MattBoyd)

Does the script work on x64 if you run it outside of a BigFix task?

You could pipe the script output to help with debugging. Example:

dos “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}” > C:\TSMConfig-Output.log 2<&1

2<&1 redirects stderr. Otherwise, you probably wouldn’t see the error in the text log.

(imported comment written by tigger0191)

I forgot to mention, yes, it does work when you simply double click the .vbs.

(imported comment written by BenKus)

Does it work if you use:

action uses wow64 redirection true

Ben

(imported comment written by tigger0191)

So here is the move and run portion of the action script as it is now:

MOVE __createfile __Download\TSMConfig.vbs

action uses wow64 redirection true

dos “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}” > C:\TSMConfig-Output.log 2<&1

This was all that was in the logfile: The filename, directory name, or volume label syntax is incorrect.

Again, it works great if I just double click it out of the __Download folder.

Thanks for the help, guys. Boyd, that output pipe is especially helpful.

(imported comment written by MattBoyd)

There

might

be a bug in the dos command. It seems like it isn’t parsing arguments surrounded by quotes properly. I’m seeing some strange behavior when quotes surround the curly braces.

This should work fine (assuming it exists):

wait cmd.exe /c “”{pathname of system folder}\cscript.exe" “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}” > C:\TSMConfig-Output.log 2<&1"

This throws the “syntax is incorrect” error:

dos “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\TSMConfig.vbs”)}” > C:\TSMConfig-Output.log 2<&1

So does this:

dos “{pathname of system folder}\cscript.exe” {("%22" & (pathname of client folder of current site) & “__Download\TSMConfig.vbs%22”)} > C:\TSMConfig-Output.log 2<&1