Hello.
How do I run a vbscript file (.vbs) from a batch file? I tried just entering
C:\Documents and Settings\Andy G\Desktop\Test.vbs
in the Batch file, but no joy.
Thanks, Andy.
Run script from batch
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Run script from batch
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
-
- PlatinumLounger
- Posts: 5416
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Run script from batch
I've never done it - but certainly (at least) you need to surround the entire line with double-quotes...
Code: Select all
"C:\Documents and Settings\Andy G\Desktop\Test.vbs"
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Re: Run script from batch
Great "and simple", thanks.
A similar question, how can I run an application from a (vb) script?
I tried
Shell "Notepad.Exe"
but it doesn't work - I can use Shell directly from MS Excel, so why not vbscript?
Thanks again. Andy.
A similar question, how can I run an application from a (vb) script?
I tried
Shell "Notepad.Exe"
but it doesn't work - I can use Shell directly from MS Excel, so why not vbscript?
Thanks again. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
-
- Lounger
- Posts: 47
- Joined: 26 Jan 2010, 01:05
Re: Run script from batch
I think you need to start it with wscript.exe or cscript.exe; your batch file would look something like
@echo off
wscript.exe "C:\Documents and Settings\Andy G\Desktop\Test.vbs"
@echo off
wscript.exe "C:\Documents and Settings\Andy G\Desktop\Test.vbs"