How would you go about writing a program that uses MS-Dos.
Ex. I wanted to open up command prompt and input the command "Start /separate e:\example.exe".
How would you go about writing a program that uses MS-Dos.
Ex. I wanted to open up command prompt and input the command "Start /separate e:\example.exe".
Use CreateProcess().
CreateProcess Function (Windows)
Start -> Run and enter "CMD". That starts a DOS window. Then type the line you want.
I think that's what you're asking. To write a program, just compile a "Console Application" or something like that. It will create an .exe file. You probably want it to be called Start.exe according to your example.
I think I may have explained that wrong. I was rather vague. I am thinking of a C program that would open up ms dos and input commands, rather then a user input. Im being vague because I generally don't know anyway to do this. Here's a better example.
ex.
1.) User compiles code
2.) Executes
3.) The program opens up command prompt
4.) It (not the user) enters "copy /y c:\example.txt c:\exfolder"
5.) Text file is copied from c: to the folder 'exfolder'
6.) Program executed successfully, it closes.
I found what I was looking for. It was the system() function. Thank you for your patience
hello.Cgrassshopper.
yes, it's system() function that you are looking for.