Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.