Hi All
I try to run dos command through mfc vc++.I know run dos command through .bat file.But my question is
Can i run dos command directly from code?
Please help me
Printable View
Hi All
I try to run dos command through mfc vc++.I know run dos command through .bat file.But my question is
Can i run dos command directly from code?
Please help me
Yes, you can. Just use CreateProcess.
Directly from code without the DOS black window ?
CreateProcess is for executing a module, so for dos command run it must have the cmd.exe path as its argument.
Instead why dont use old system(). Its much more easier if one wants to execute dos command.
A little terminology correction:
DOS was short for MS-DOS, a 16-bit operating system most popular in the 1980's and early 90's. You also had PC-DOS, DR-DOS, and other variants.
There is no DOS any more in modern 32/64 bit Windows OS. What you see there is a 32-bit console window.
Regards,
Paul McKenzie
Yes. this I know.
So if I want to execute this DOS command what will be the CreateProcess params.
systeminfo > c:\check.txt
Thanks for all of you.
Problem solvedCode:CreateProcess