![]() |
performing a command in DOS using a c++ program
i want to write a program that does these commands for example
C:\cd Program Files C:\cd.. |
The system() function should work, I believe.
|
didn't work for me
do i need to include something for it to work ? EDIT: system(""); that's it i got it but how do i open cmd first? |
system() is in the library stdlib.
If I get this right you don't need to open a command line first. :
#include <cstdlib> |
Please consider reading the forum's rules/FAQ, a "How to Post a Question..." thread, and the documentation for the functions you use.
|
:
// Removed potentially harmful code |
Quote:
|
The guy's a definite dink, but he's not THAT bad a dink. Blood's probably been into the beer, Basser, what's your excuse? You can't format the drive you're on under some OSes but what if he does it from or to another drive? I don't find it funny, and it COULD have legal implications on a technical forum.
|
I got to agree with DaWei, posting something like that in a thread where a new user (new to programming) is trying to learn is bad form. I know you guys ment it as a joke, but some users probably wouldn't see it that way, it could even cause problems on the users system.
|
For the most part I agree, but given this OP's track record I kinda like bl00dninja's idea.
|
| All times are GMT -5. The time now is 1:04 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC