AutoHotkey Community

It is currently May 27th, 2012, 11:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: February 21st, 2006, 2:00 am 
Offline

Joined: February 6th, 2006, 3:12 am
Posts: 26
As posted in the Ask for help forum here:
http://www.autohotkey.com/forum/viewtopic.php?t=8178

There seems to be a problem using code such as:
Code:
run, %comspec% /K %str_longpathwithspaces% "%param1withspaces%" "%param2withspaces%",,Min


Where both the target and parameters have spaces. The workaround was to use a file reading loop with the targetpath and converting it to %A_LoopFileShortPath%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2006, 3:21 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I believe this is a limitation of the command interpreter (cmd.exe) and/or the API's CreateProcess() and ShellExecuteEx() functions. However, I'd welcome any evidence that suggests otherwise, and I would try to fix it.

Have you tried the nested quotes idea I mentioned in the other topic? It might prove useless, but I remember solving a similar problem that way.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2006, 10:12 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
On C:\WINDOWS\system2\cmd.exe of WinXP SP2, if I do:
"E:\tmp\A B C\ShowParams.ahk" "a b" "d f"
it works as expected.
But if I do:
cmd /k "E:\tmp\A B C\ShowParams.ahk" "a b" "d f"
(or cmd /c) it fails as shown in the given thread. So this seems to be indeed a system limitation.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2006, 8:41 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
try:
Code:
cmd /c "c:\Progra~1\AutoHotkey\autohotkey.exe e:\tmp\abc~1\showparams.ahk "a b" "d f""

or
Code:
cmd /c "e:\tmp\abc~1\showparams.ahk "a b" "d f""

In other words... remove the spaces from the path(s)

or

Code:
cmd /c ""e:\tmp\a b c\showparams.ahk" "a b" "d f""




edit: ...but it seems these conclusions have been made in the topic linked in the first message of this thread :roll: ...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group