0

I have a simple vbscript which runs an Exe program both vbscript and exe program are in the same folder c:\xxx, i want this script to run every time the machine restarts as we have 40 servers and restarting manually is not feasible.

I have added a value into the registry HKEY_CURRENT_USER/software/microsoft/windows/currentversion/Run

When i restart the server it says "file not found", both vbscript and Exe are definitely in the correct folder.

If i run the VBscript manually it works fine.

The script is as follows

Set wshshell = wscript.CreateObject("WScript.Shell")

WshShell.Run "c:\xxx\checkit.exe"

Thanks Tony

Tony
  • 1

1 Answers1

1

You should call the program directly from the Run key, the VBS doesn't add any value here.

Edit: Thinking about this a little more, a startup script GPO is probably even better if this is going across 40 machines. You configure it in Computer Configuration/Policies/Windows Settings/Scripts/Startup.

You just create a batch file that has "c:\xxx\checkit.exe" in it, link it to that policy, and you're done.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
  • Great, thanks, can i run the exe with parameters/options it needs. Sorry for the noob question but i come from an AS400 midrange background and am struggling with windows server. thanks again for your help. – Tony Apr 20 '13 at 12:27
  • Yeah, you can do that. I also added an additional option that might be even better as an edit to my answer. – MDMarra Apr 20 '13 at 13:28