Shell command

DOS specific questions.
Post Reply
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Shell command

Post by Gablea »

Hi all,

Just wanted to make sure I was remembering this correctly

Can I run a batch file from with in my dos application?

Example

Code: Select all

shell update.bat /update 
The update.bat file hold xcopy commands to copy over files and depending on the / option it would either just update files or copy all files no matter what.

Would the update.bat file run and then return to the same spot in my program?
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Shell command

Post by caseih »

I think you have to put the actual commands you want shell in a string, don't you? But yes that should work. And yes, shell will suspend your program's execution, run the commands you passed it, and then continue on in your program.

I'm not sure how MS-DOS dealt with trying to change the very file you're running, should update.bat do something with the executable you're running. Windows would just give you an error message. One would think that after all these decades, MS filesystems would be able to deal with replacing in-use files without resorting to reboot hacks. But oh no.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Shell command

Post by Gablea »

I am not actually updating the exe it is just the data files that the system uses

I am copying from a Network Drive to the local RAM Drive. I am using the RAM Drive to hopefully speed up the data recall function
Post Reply