![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2006
Posts: 20
Rep Power: 0
![]() |
i want to write a program that does these commands for example
C:\cd Program Files C:\cd.. |
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
The system() function should work, I believe.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2006
Posts: 20
Rep Power: 0
![]() |
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? |
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
system() is in the library stdlib.
If I get this right you don't need to open a command line first. #include <cstdlib>
// ...
system("Some command");
__________________
-- v0id
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Please consider reading the forum's rules/FAQ, a "How to Post a Question..." thread, and the documentation for the functions you use.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6
![]() |
// Removed potentially harmful code
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. Last edited by Mjordan2nd; Sep 15th, 2006 at 12:23 PM. Reason: Potentially harmful code |
|
|
|
|
#7 | |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4
![]() |
Quote:
__________________
Learning to use C++ and loving every minute of it. Last edited by Mjordan2nd; Sep 15th, 2006 at 12:24 PM. Reason: Potentially harmful code |
|
|
|
|
|
#8 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers Last edited by DaWei; Sep 15th, 2006 at 9:06 AM. |
|
|
|
|
#9 |
|
Programming Guru
![]() ![]() |
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.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
#10 |
|
Professional Programmer
|
For the most part I agree, but given this OP's track record I kinda like bl00dninja's idea.
__________________
Amateurs built the ark Professionals built the Titanic |
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Language display in program | Prm753 | C++ | 3 | May 30th, 2006 6:45 PM |
| Help me program this with Watcom! | DBZ | Other Programming Languages | 3 | Feb 26th, 2006 10:41 PM |
| Creating a program to test a program | sixstringartist | C | 8 | Jan 21st, 2006 2:15 PM |
| Nonsense Name generator program | chillster13 | C | 14 | Jun 17th, 2005 3:05 AM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 5:12 PM |