Jump to content











Photo
- - - - -

ShellExecute - cmd problem


  • Please log in to reply
9 replies to this topic

#1 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

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.

:cheers:

#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12701 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 May 2010 - 09:06 PM

Please tell me: Which WB version?

Peter

#3 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 15 May 2010 - 09:10 PM

WB080SP3

:cheers:

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12701 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 15 May 2010 - 09:14 PM

WB080SP3

:cheers:

Allow me to check tomorrow. Now it's late enough (and I'm viewing TV about Bayern / Werder etc. ...)

Peter :cheers:

#5 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 15 May 2010 - 09:22 PM

[german]
Wenn's denn sein muß. :cheers:
[/german]

ok.

:cheers:

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12701 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

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):

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12701 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 May 2010 - 09:30 AM

This works in 081 with your intended result: :cheers:
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 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

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?

:cheers:

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12701 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 16 May 2010 - 02:39 PM

No way to have one command covering both?

The code I gave above, works for BOTH cases! :lol:

Peter

#10 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

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.

:lol:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users