[code]
#include <stdlib.h>
int main(void)
{
system("cmd.exe");
system("dir/w");
system("cd debug");
return 0;
}
[\code]
i run the program but only the first command was ran,
what's the problem??
please help, thank you
[code]
#include <stdlib.h>
int main(void)
{
system("cmd.exe");
system("dir/w");
system("cd debug");
return 0;
}
[\code]
i run the program but only the first command was ran,
what's the problem??
please help, thank you
To make sure all of them are ran try putting system("pause") inbetween each of the commands.
after putting system("pause") in between ,it still remains the same.
i am using visual c++ .net ,is it the problem?
well, dir /w waits for a user response, and you're not sending it one
so pause won't matter, you need ot try regular dir or come up with a way to send a keypress to the dos box.
PHP and XML
Let's talk about SAX
[code]
#include <stdlib.h>
int main(void)
{
system("pause");
system("dir/w\n");
system("pause");
system("cd\\Debug");
system("pause");
system("dir/w");
}
[\code]
the problem is.....the command cd\\debug dun work, it said
"the system cannot find the path specified"
i have tried "cd debug", "cd\debug" but all are failed.
i know that the current directory in in c:\documents and settings .........\test, but i cant enter the directory "debug" inside,
also i cant go back to the c drive
what should be type in order to do so?
thank you for helping
For changing your directory to debug just change the directory all at one time (make sure you spelled it right and you are doing it from its parent directory). And to change your directory to C:\ just use the command "cd \".
i have tried that before , but fail when i build the project, error said :
error c2001: newline in constrant line 7
error c2146:syntax error:missing ) before system line 8
it seems that the character "\" cant be reconised by c++, i wonder what should be substituted.
\\ or /
i will try to find it out....