Connecting Tech Pros Worldwide Forums | Help | Site Map

Dos Batch Files

Grey
Guest
 
Posts: n/a
#1: Jul 8 '06
I have some really old games which run in Dos, which have to be started from
a batch file. I am using VB5 and would like to create a program which will
run a batch file with a click of a button. How do I run .bat's from VB?

Graham



Max
Guest
 
Posts: n/a
#2: Jul 9 '06

re: Dos Batch Files


Private Sub Command1_Click()
Shell ("c:\xxx.bat")
End Sub



"Grey" <grahame9@btinternet.comwrote in message
news:JIadnWd237FZri3ZnZ2dnUVZ8qKdnZ2d@bt.com...
Quote:
>I have some really old games which run in Dos, which have to be started
>from
a batch file. I am using VB5 and would like to create a program which will
run a batch file with a click of a button. How do I run .bat's from VB?
>
Graham
>
>

Dean Earley
Guest
 
Posts: n/a
#3: Jul 10 '06

re: Dos Batch Files


Max wrote:
Quote:
Private Sub Command1_Click()
Shell ("c:\xxx.bat")
End Sub
NEVER put brackets around a single parameter like that unless you know
exactly what it is doing. If you do this, it WILL bite you in the back
one day.

You should only use brackets when using the return value of the function
(which includes call) or when you explicitly want a parameter to be
evaluated (Which is why it will fail when you try and pass an object)

--
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems
Max
Guest
 
Posts: n/a
#4: Jul 11 '06

re: Dos Batch Files


Good point

bit of a typo from me


"Dean Earley" <dean.earley@icode.co.ukwrote in message
news:44b23e99$0$10943$fa0fcedb@news.zen.co.uk...
Quote:
Max wrote:
Quote:
>Private Sub Command1_Click()
> Shell ("c:\xxx.bat")
>End Sub
>
NEVER put brackets around a single parameter like that unless you know
exactly what it is doing. If you do this, it WILL bite you in the back one
day.
>
You should only use brackets when using the return value of the function
(which includes call) or when you explicitly want a parameter to be
evaluated (Which is why it will fail when you try and pass an object)
>
--
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
>
iCode Systems

Closed Thread