how to run dos command by programming??
is there any examlpes?
thank you for helping.
Printable View
how to run dos command by programming??
is there any examlpes?
thank you for helping.
look up system()
Try reading the FAQ
i am a new comer .......could you please tell me more about that?
thank you so much
Use system(). If I wanted to use the command "cd C:\WINDOWS" I would use system() like-
and it would change the current directory to C:\WINDOWS\.Code:system("cd C:\WINDOWS\")
More than how to follow a link?Quote:
Originally posted by Jasonymk
i am a new comer .......could you please tell me more about that?
thank you so much
>>system("cd C:\WINDOWS\")
Not very useful, in practical terms. It doesn't change the current working directory.
thank you so much!!
whne i build a new project for it, what should i made?
win 32 console application?
If you want it to be ran in the MS-DOS window then yes.
i have made a program as below:
the output is a comand prompt but not cmd.exe, but with the tilte testing.exe(testing, which is my project name), and i cant use system() to go back to c:/Code:/*
#include <stdlib.h>
int main(void)
{
system("cmd.exe");
return 0;
}
*/
what should i do?
>what should i do?
Explain what you are trying to do, think it through thuroughly, and try again ;)
at the beginning , i wanna start a acrobat distiller with c++, but is seems too difficult for me, then i found that i can use dos command to start the distiller in the dos prompt.
what i am trying to do is to write a program, which is used to start the distiller, and so serveral operations automatically once the program being ran.
and first i would like to try out out to use C++ to control the dos prompt. but fail.
for example, how to generate a dos prompt(cmd.exe) from a program?
i cant do so in the program i have post before, is ti because i have use the win32 console application?