Shell command

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

Shell command

Postby Gablea » Feb 04, 2019 23:13

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: 1315
Joined: Feb 26, 2007 5:32

Re: Shell command

Postby caseih » Feb 05, 2019 1:02

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: 1037
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Shell command

Postby Gablea » Feb 05, 2019 8:58

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

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 1 guest