Trying to run a vbs script usng the Runas command

I am trying to run a vbs scruip using the runas command buy it says it's not a valid Win32 application.

runas /savecred /user:username c:\script.vbs

RUNAS ERROR: Unable to run - c:\script.vbs
193: c:\script.vbs is not a vaild Win32 application.

What are the alternatives?
ascndAsked:
Who is Participating?
 
fostejoConnect With a Mentor Commented:
ascnd,

Try runas /savecred /user:username "wscript.exe c:\script.vbs" instead..

cheers
0
 
ascndAuthor Commented:
Oh yeah baby that works just fine!  Thank you thank you!
0
 
fostejoCommented:
No problem ascnd!

I suspect that the user you're 'running as..' doesn't have the .VBS file extension associated with either wscript or cscript - it's always a good idea to specify the application to run the script with to avoid issues like this - in a corporate enviroment, you'd find that the I.T. people (developers etc.) would have associated VBS files with their fave editor for example ...

cheers

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.