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

HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run:

"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:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

4

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

Answered 03/08/2013 by: jagadeish
Red Belt

Please log in to comment

Answers

0

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

Please log in to comment
Answer this question or Comment on this question for clarity