473,508 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dos Batch Files

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
Jul 8 '06 #1
3 10101
Max
Private Sub Command1_Click()
Shell ("c:\xxx.bat")
End Sub

"Grey" <gr******@btinternet.comwrote in message
news:JI******************************@bt.com...
>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


Jul 9 '06 #2
Max wrote:
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 (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Jul 10 '06 #3
Max
Good point

bit of a typo from me
"Dean Earley" <de*********@icode.co.ukwrote in message
news:44***********************@news.zen.co.uk...
Max wrote:
>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 (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems

Jul 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3478
by: Moosebumps | last post by:
So, after reading some messages about os.system, and looking at the popen stuff and trying it a bit, I still have not found a way to keep a command window open for several commands (on Windows...
1
4176
by: Bernhard Sollfrank | last post by:
Hello, i have to start a batch process from a dll to transfer files created by this dll to remote ftp server. I created a batch file: ftp -n -v -i -s:D:\batch\ftpcmds.txt ftp-server and a...
2
2708
by: Herb Stevenson | last post by:
Hello all. I need to set up a batch file to work w/ the Visual Studio.NET 2003 command prompt. However, when I run the batch file it uses the standard command prompt. Is there a way to...
7
9048
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files...
0
2559
by: Steve Jorgensen | last post by:
I remember that I used to set up utility batch files, and create Windows shortcuts to them that would ask the user for parameters to supply to the batch files. From what I can tell, this...
6
11192
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
3137
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
2
1641
by: Stephen | last post by:
Hi all, I want to create an app that runs a batch file which inturn runs applications. question: if I start the batch file from app1, how can app1 know that the batch file ran successfully...
3
4432
by: emman_54 | last post by:
Hi every one, I am trying to run a batch file using my asp.net application. I am using the Process class to run the batch file. When I run my web application, In the task manager, i could see...
4
2629
by: | last post by:
Hello, I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.