Im a beginner in c++ and i want to know how to use system() in c++
I know how to check whether a cmd processor exists.
i want to know how to execute commands in the processor.
I want its syntax and if anyone can explain with an xample well and good. Thanks in advance

Regards,
RAGHAV

Recommended Answers

All 3 Replies

i already saw that tom...im unable to understand where i should replace the command....if u can explain please do so...

I do not understand what you want. The argument to system() is the same thing you would type in a console window. If you want to move files in Windows or DOS, the console command might look like this:

C:\>move c:\windows\temp\*.* c:\temp

The string you pass to system() for that same command is exactly the same:

system("move c:\windows\temp\*.* c:\temp");

Maybe if you explain what you are trying to use the system() function for, I can help more.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.