Jump to content

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


eHrgo
 Share

Recommended Posts

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.
Link to comment
Share on other sites

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.
Link to comment
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

Link to comment
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.
Link to comment
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.
Link to comment
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 ?

Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...