Sign in to follow this  
Followers 0
eHrgo

[RunWait] - Spaces in .exe path...

15 posts in this topic

#1 ·  Posted (edited)

Hello,

In a part of one of my big untidy programs i have:

RunWait ( @ComSpec & ' /k ' & $RarDir )oÝ÷ Ùh^l¡×¥¢%G­«ZºÚ"µÍ[ØZ]
ÛÛTÜXÈ  [È ÌÎNÈÚÈ ÌÎNÈ [È ÌÎNÐÎÔ^IÌÎNÈ
oÝ÷ Øp¢¹,¥êßyËeË­Ê&©Ý±·¡wAºÙ²Ó~j°â®ö«¦åz¬²¶)²ÊZqë"+gjg¥GºÚ"µÍ[ØZ]
ÛÛTÜXÈ  [È ÌÎNÈÚÈ ÌÎNÈ [È ÌÎNÐÎÑØÝ[Y[[Ù][ÜËÓYKÔ^IÌÎNÈ
oÝ÷ Ùh^*î+b¶×¥gßп.éíßجZr¦jw_W¿nÊ+¯(¡j÷­éÜ«¨¶»§ªê-½êìç¢Ç+yéìljö¢¦åxn¶«¨µëºÛç«®ðØl¢g­)à)jëh×6RunWait ( @ComSpec & ' /k ' & '"C:/Document and Settings/Me/Rar.exe"' )oÝ÷ ÙaڵƧڢ».­è®±çe¢Ú±ëmx,jëh×6   RunWait ( @ComSpec & ' /k ' & $RarDir  & ' A -sfx ' & $NamedPathed & $FilesDir)

It's the winrar packager..... the problem seem to come from spaces.

Sorry for my English, THANKS a lot. :P

Edited by eHrgo

Sorry for my Bad English.

Share this post


Link to post
Share on other sites



So it will work:

RunWait ( @ComSpec & " /k " & 'C:/Document and Settings/Me/Rar.exe' )

Best Regards BugFix  

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

hum, sorry but it isn't..

Same error message :

If i try to translate the error message:

'C:/Document' is not recognize as an intern or extern command, or a command file.

When i try to enter :

"C:/Document and Settings/Me/Rar.exe" in a dos window, it works.... autoit doesn't seems to understand "spaces" in file's path [like %20 shit on internet :D].

Thanks to Help me!

Edited by eHrgo

Sorry for my Bad English.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

RunWait(@ComSpec & " /k " & '"C:\Document and Settings\Me\Rar.exe"')

edit - oops, wrong slashes.

Edited by xcal

Share this post


Link to post
Share on other sites

hey all of you goofs.... it isn't supposed to be "C:\Document and Settings" document is supposed to be plural... :P example "C:\Documents and Settings\Me\Rar.exe"


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Why do you have to bring @comspec into this ?

Run("C:\Documents and Settings\Helge\Desktop\myfile.exe")

Share this post


Link to post
Share on other sites

It's the winrar packager..... the problem seem to come from spaces.

Corrections using double quotes to help with spaces.

RunWait ( @ComSpec & ' /k "' & $RarDir & '"' )

RunWait ( @ComSpec & ' /k "C:/Rar.exe"' )

RunWait ( @ComSpec & ' /k "' & @MyDocumentsDir & '\Rar.exe"' )

RunWait ( @ComSpec & ' /k "' & @MyDocumentsDir & '\Rar.exe"' )

RunWait ( @ComSpec & ' /k "' & $RarDir  & '" A -sfx "' & $NamedPathed & '" "' & $FilesDir & '"' )
oÝ÷ Ø ­ç°ØGzX¶­
¥ç"²«ªlgyç^u:zË«y§]x¢æåz«¨µë-¡«"^r¦jw]¡ëË«zËqë,jëh×6
Run ( '"C:\Documents and Settings\Helge\Desktop\myfile.exe"' )

:P

Share this post


Link to post
Share on other sites

Thanks all, im gonna try that.. I need a ComSpec because i use lot of launch settings, i want to pack few files in a -sfx etc.....

RunWait ( @ComSpec & ' /k ' & $RarDir  & ' A -sfx ' & $NamedPathed & $FilesDir)

Actually my real dir is something like:

D:\DISQUE G\Programmation\.....

But it's french, so i explained you with something you could understand :P

Thanks, trying.


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

Ok thanks guys, i suceed, one quote was missing:

RunWait ( @ComSpec & ' /k ""' & $RarDir  & '" A -sfx "' & $NamedPathed & '" "' & $FilesDir & '"' )

...& ' /k ""' &

I don't know why, but it doesn't work with only one, now it's perfectly working, thanks.


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

Still, you don't need to use @comspec. Run supports exe-files, which is exactly what @comspec

and your file is. So, you're making a exe-file run another exe-file, when you can just run it directly.

It's like grabbing your mother by her feet and use her to hit your father. Why bother ?

Share this post


Link to post
Share on other sites

I don't understand, this line is a part of a big program with GUI, inputs, etc...

The program "rar.exe" is not mine, it's the Winrar packer, how can do this operation without using ComSpec?

Sorry, I'm new, I Dont understand...


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Why did you choose to put in @comspec in your code ? My guess is that you've seen people use it in their

code, but where they used it with files that weren't supported directly by Run (such as JPG and TXT).

In the helpfile it says that it can run the following types of files : EXE, BAT, COM and PIF. You want to run

a EXE-file, so there's no need use @comspec at all. Just give Run() the EXE-file and the parameters to pass

it. That's it. Example I just tested :

Run('"' & @ProgramFilesDir & '\WinRAR\RAR.exe" A -SFX "c:\my archive with spaces.rar"', "", @SW_HIDE)

EDIT : Note that when using Run() the script will run the file and then continue immediatelly. If you want

the script to wait till the making of the archive is finished then you just have to use RunWait instead...

Edited by Helge

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Thanks, i changed, i don't see any differences but.....

Only one other question, you seem to know winrar commands.... Do you know how can i pack only specified files in my archive? Because i found -n<Files> but i think i don't use good syntax.....

I used:

Run('"' & @ProgramFilesDir & '\WinRAR\RAR.exe" A -SFX -n"C:\MyFile.jpg" -n"C:\OtherFile.jpg" "c:\my archive with spaces.rar"', "", @SW_HIDE)

But it return me an error : "WARNING: no files" It doesn't seems to understand my command, and ignore it.....

Thanks, and sorry for the off-topic..

Edited by eHrgo

Sorry for my Bad English.

Share this post


Link to post
Share on other sites

Only one other question, you seem to know winrar commands.... Do you know how can i pack only specified files in my archive? Because i found -n<Files> but i think i don't use good syntax.....

Hmm.. on my version of WinRAR, I can't find -n switch.

Share this post


Link to post
Share on other sites

Hum..... im gonna use my first idea, copy files in a dir, and delete it..... Thanks


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0