Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created short script to run .bat file on background but when i execute .vbs file, it seems like it is not reading my script at all. .Dos windows pops up and shutdown right away but my batch file is never executed. (when i execute batch file directly, it works fine, so I'm assuming this script is the problem)

Dim sCurPath
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN(sCurPath & "\myrun.bat", 0, True)

This code works on my desktop, windows 7 32 bit but when i try to execute this script on windows server 2008 R2, it won't do anything. Does anyone know what I need to do to run this .vbs script on windows server?

share|improve this question
are you using csript or wscript to execute the .vbs? –  Keltari Apr 25 '13 at 14:28
what do you mean? i just have .vbs file and i'm just clicking .vbs file to execute, which works on my desktop but not server computer –  user219786 Apr 25 '13 at 15:15
@Keltari Nvm, it is running in wscript on my desktop –  user219786 Apr 25 '13 at 16:31

1 Answer 1

Based on my comment, it would appear you were trying to WSH script in the command shell script environment. These are not interchangeable. It would appear you are using the right script host now.

share|improve this answer

Your Answer


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.