Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Command argument problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Fri Jan 22, 2010 3:12 pm    Post subject: Command argument problem Reply with quote

Hi, i'm coding a small app with visual c++ that recieve a directory as an argument for later do the work, so i run it with cmd like: >app.exe C:\Program Files

now here comes to problem, i want "C:\Program Files" be on argv[1] and i get argv[1] = C:\Program and argv[2] = Files... does anyone know how to fix this problem?

_________________
+~
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jan 22, 2010 4:23 pm    Post subject: Reply with quote

put the path in quotes
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Fri Jan 22, 2010 6:01 pm    Post subject: Reply with quote

i think you have to use double \'s if i remember correctly..
like...

Code:
"C:\\Program Files\\WhateverUWant\\app.exe"

_________________
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jan 22, 2010 6:07 pm    Post subject: Reply with quote

manc wrote:
i think you have to use double \'s if i remember correctly..
like...

Code:
"C:\\Program Files\\WhateverUWant\\app.exe"

you don't. that is a separate thing, breaking out of control characters
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Sat Jan 23, 2010 1:46 am    Post subject: Reply with quote

manc wrote:
i think you have to use double \'s if i remember correctly..
like...

Code:
"C:\\Program Files\\WhateverUWant\\app.exe"


No, i get it right if i use a non-whitespace path.

Thanks Slugsnack, now it work

_________________
+~
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sat Jan 23, 2010 4:42 am    Post subject: Reply with quote

Just a sidenote if you need, to escape a quote from command line, use double quotes:
Code:
"value with whitespace=""hello"""
so it becomes
Code:
value with whitespace="hello"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites