Scripting Question

Changing location of where wscript.exe looks for VBScripts.

03/08/2013 10160 views

I have the following value set in the value set so that a launch script automatically starts at logon:


"C:\Windows\SysWOW64\wscript.exe" "c:\program files (x86)\<directory>\nameofscript.vbs" <argument1>

At logon the script does start, but I'm presented with the error message:

"Can not find script file "C:\Program files\<directory>\nameofscript.vbs"

It then proceeds to launch the script correctly, but I'm still faced with the error message.

So apparently even if I hardcode the %programfiles(x86)% it still looks first in %programfiles%, even though the key is in the 32-bit hive and I'm using the 32-bit version of wscript.exe.

How do I change this behaviour, so that it first looks in %programfiles(x86)%?

Answer Summary:
0 Comments   [ + ] Show comments


Community Chosen Answer


%WinDir%\SysWoW64\CScript.exe //B //nologo "%ProgramFiles(86)%\MyAppFolder\MyVBSFile.vbs"

Answered 03/08/2013 by: jagadeish
Red Belt

All Answers


I appreciate your input.

[For testing purposes] I have hardcoded the path to "C:\Windows\Syswow64\wscript.exe" and to "C:\Program files (x86)\<directory>\nameofscript.vbs". It still launches the System32 version of wscript, and looks firstly in Program files.

I've also scanned the package for anything that may override this setting, and I've come up with nothing.

Any further ideas?

Answered 03/08/2013 by: Normannen
Orange Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ