Take the 2-minute tour ×  I'm trying to write a VBScript (.vbs)
script that uses the WScript.Shell Run() method, but it seems as
though Run() can't find the file I'm passing in.  I've boiled my
script down to the following code that will reproduce the
results. This can be copied to a text editor, saved as test.vbs
and ran. The type command simply outputs the text inside the
file passed in.  Dim WShell Set WShell =
WScript.CreateObject("WScript.Shell")  WShell.Run("type
C:\inetpub\wwwroot\iisstart.htm")  Set WShell = Nothing  If you
were to run the code in Run() directly from the CMD prompt, it
works fine. But when it's run from inside a .vbs script and
using Run(), it gives me the following error:  Test.vbs(4, 1)
(null): The system cannot find the file specified.  I can run
other commands using Run() just fine, but when I try to pass in
a path it fails. Exec() fails with the same error by the way.
Any ideas?  share|improve this question  1 Answer 1  up vote 6
down vote accepted  Try this  Set oShell = CreateO