?
Solved

Calling a Batch (.bat) file from a VBS file

Posted on 2005-05-11
1
Medium Priority
?
461 Views
Last Modified: 2010-04-17
From a VBS file, is it possible to call a Batch file?

From a Batch file, I know that if you issue the command "call test.bat", this will actually call another the test.bat file.

How can this be done in a VBS script file? How do you call a Batch (.bat) file from a VBS file?

Thanks
0
Comment
Question by:ben1211
1 Comment
 
LVL 2

Accepted Solution

by:
it_proffen earned 2000 total points
ID: 13976321
Check the documentation for the run method and try this:

Set WshShell = WScript.CreateObject("WScript.Shell")
WSHShell.run("\\server\folder\setup.bat",7,true)

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question