Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a BAT from VB

Status
Not open for further replies.

JeremyM

Programmer
Nov 10, 2000
33
0
0
US
Does anyone know what command in VB allows you to run a BAT file ?

I need to run a map.bat file while in vb.

Thanks,
Jeremy
 
the Shell Command
Shell("C:\map.bat", vbHide) will run it without showing the DOS window.
Shell("C:\map.bat") will run it in a visible window
also, since it is a function you need to assign the ruturn code to a variable

Dim RetCode
RetCode = Shell("C:\map.bat") Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
Shell ("Command.com /c c:\map.bat" ) it close the Dos Window

eric
Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
If you activate the Scripting Library reference you can run most of the DOS commands( like copy files )directly from a line of VB code without having to use a DOS window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top