ShellExecute - cmd problem
Started by
MedEvil
, May 15 2010 09:00 PM
9 replies to this topic
#1
Posted 15 May 2010 - 09:00 PM
I have a little problem getting a command to work. Something's wrong.
It is suppose to work with and without spaces in the pathname.
So far i can only have one or the other. Below is the one i thought should work regardless.
ShellExecute,open,"cmd.exe","/k #$q%ProjectDir%\Read.exe#$q > #$q%ProjectDir%\parameters.txt#$q"
Also tryed:
ShellExecute,open,"#$q%ProjectDir%\Read.exe#$q","> #$q%ProjectDir%\parameters.txt#$q"
Same result. Nothing is written to parameters.txt.
It is suppose to work with and without spaces in the pathname.
So far i can only have one or the other. Below is the one i thought should work regardless.
ShellExecute,open,"cmd.exe","/k #$q%ProjectDir%\Read.exe#$q > #$q%ProjectDir%\parameters.txt#$q"
Also tryed:
ShellExecute,open,"#$q%ProjectDir%\Read.exe#$q","> #$q%ProjectDir%\parameters.txt#$q"
Same result. Nothing is written to parameters.txt.
#2
Posted 15 May 2010 - 09:06 PM
Please tell me: Which WB version?
Peter
Peter
#3
Posted 15 May 2010 - 09:10 PM
WB080SP3
#4
Posted 15 May 2010 - 09:14 PM
Allow me to check tomorrow. Now it's late enough (and I'm viewing TV about Bayern / Werder etc. ...)WB080SP3
Peter
#5
Posted 15 May 2010 - 09:22 PM
[german]
Wenn's denn sein muß.
[/german]
ok.
Wenn's denn sein muß.
[/german]
ok.
#6
Posted 16 May 2010 - 08:53 AM
Sorry, for me this seems NOT to be a WinBuilder issue.
Execute manually the command ShellExecute processes (use your paths):
Billy the Door has some concerns when the path contains a space.
Peter
Execute manually the command ShellExecute processes (use your paths):
cmd /k "V:\wb\wb debug !\Projects\nativeEx_barebone\Read.exe" > "V:\wb\wb debug !\Projects\nativeEx_barebone\parameters.txt"
Billy the Door has some concerns when the path contains a space.
Peter
#7
Posted 16 May 2010 - 09:30 AM
This works in 081 with your intended result:
Peter
StrFormat,LEFT,%ProjectDir%,2,%Drive% Set,%cmd%,%Drive% &CD #$q%ProjectDir%#$q &Read.exe > parameters.txt ShellExecute,open,cmd.exe,/k %cmd%"in 080 you have to use quotes where necessary.
Peter
#8
Posted 16 May 2010 - 11:06 AM
So it's like i said, i need to have one command working with spaces and another one to work without spaces. No way to have one command covering both?
Any idea, why the command works regardless of space / no space, when run from a bat file?
Any idea, why the command works regardless of space / no space, when run from a bat file?
#9
Posted 16 May 2010 - 02:39 PM
The code I gave above, works for BOTH cases!No way to have one command covering both?
Peter
#10
Posted 16 May 2010 - 05:14 PM
It was unfortuanete, that i over simplyfied the problem in the example. The exe and the txt file are not in the same folder or i would need to write to the tools folder.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users