system("FarCry.exe");
wont start fracry unless its in the same folder is there any other way to start a program outside the folder the .exe is in?
system("FarCry.exe");
wont start fracry unless its in the same folder is there any other way to start a program outside the folder the .exe is in?
Put the path of the exe in the system call
Woop?
Having said said, you should also be aware of the options and pitfalls
Warning: Opinions subject to change without notice
The C Library Reference Guide
Understand the fundamentals
Then have some more fun
it still does not work, it compiles allright but when i try and run it, it does not open the file i added system("pause"); to see what was wrong 'C://Docuaments' is not recognized as an internal or external command
operable program or batch file.
does anyone know how to fix this
Code:#include <iostream> using namespace std; int main() { system("C:\\Docuaments And Settings\\wmorrish\\destop\\a.txt"); system("pause"); }
Last edited by cgod; 10-18-2004 at 11:39 PM.
maybe if you learned to spell you wouldn't have that problem
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
yeah..
i fixed the spelling error but im still getting the same 'C://Documents' is not recognized as an internal or external command
operable program or batch file
you are using the forward slash in your path instead of the backward slash.
- "Problem Solving C++, The Object of Programming" -Walter Savitch
- "Data Structures and Other Objects using C++" -Walter Savitch
- "Assembly Language for Intel-Based Computers" -Kip Irvine
- "Programming Windows, 5th edition" -Charles Petzold
- "Visual C++ MFC Programming by Example" -John E. Swanke
- "Network Programming Windows" -Jones/Ohlund
- "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
- "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel
i tired backward slash to. could someone write an example system("file");
with path so i can see
i just tried this
and it works fineCode:#include <stdlib.h> int main(void) { system("D:\\fasm\\fasmw.exe"); system("pause"); return 0; }
Last edited by sand_man; 10-19-2004 at 07:49 AM.
Maybe system() only works with the 8.3 filename format. Try
"c:\\docume~1\\wmorrish\\desktop\\a.txt"
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
Just trying to do a system("whatever.txt") command isn't going to do anything right? It would probably say something like "invalid command or filename". Shouldn't it be more along the lines of system("notepad.exe whatever.txt") or you can maybe use the ShellExecute function? You can run things like EXEs that way but to open something like a document requires a little bit more.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
wow thanks theworked what does the docume~1 mean?Code:"c:\\docume~1\\wmorrish\\desktop\\a.txt"
wow... first you want to copy a program, then you want to restart the system and now you want to run another program using the system call... maybe you could instead write a program to write a batch file or registry key and turn off (possibly crash?) the computer so whenever somebody turns it back on, your batch file/registry key runs a program that then does whatever it wants
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
>>what does the docume~1 mean?
It's how a filename or path is represented when the actual filename exceeds 8 characters. If you have "asdfasdf" it will just be "asdfasdf", but if you have "asdfasdffdsafdsa" then it will be "asdfas~1".
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.