eHrgo Posted December 25, 2006 Posted December 25, 2006 (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. Edited December 25, 2006 by eHrgo Sorry for my Bad English.
BugFix Posted December 25, 2006 Posted December 25, 2006 So it will work: RunWait ( @ComSpec & " /k " & 'C:/Document and Settings/Me/Rar.exe' ) Best Regards BugFix
eHrgo Posted December 25, 2006 Author Posted December 25, 2006 (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 ]. Thanks to Help me! Edited December 25, 2006 by eHrgo Sorry for my Bad English.
xcal Posted December 25, 2006 Posted December 25, 2006 (edited) RunWait(@ComSpec & " /k " & '"C:\Document and Settings\Me\Rar.exe"') edit - oops, wrong slashes. Edited December 25, 2006 by xcal How To Ask Questions The Smart Way
Somerset Posted December 26, 2006 Posted December 26, 2006 hey all of you goofs.... it isn't supposed to be "C:\Document and Settings" document is supposed to be plural... example "C:\Documents and Settings\Me\Rar.exe"
Helge Posted December 26, 2006 Posted December 26, 2006 Why do you have to bring @comspec into this ? Run("C:\Documents and Settings\Helge\Desktop\myfile.exe")
MHz Posted December 26, 2006 Posted December 26, 2006 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"' )
eHrgo Posted December 26, 2006 Author Posted December 26, 2006 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 Thanks, trying. Sorry for my Bad English.
eHrgo Posted December 26, 2006 Author Posted December 26, 2006 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.
Helge Posted December 26, 2006 Posted December 26, 2006 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 ?
eHrgo Posted December 26, 2006 Author Posted December 26, 2006 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.
Helge Posted December 26, 2006 Posted December 26, 2006 (edited) Why did you choose to put in @comspec in your code ? My guess is that you've seen people use it in theircode, 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 runa EXE-file, so there's no need use @comspec at all. Just give Run() the EXE-file and the parameters to passit. 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 wantthe script to wait till the making of the archive is finished then you just have to use RunWait instead... Edited December 26, 2006 by Helge
eHrgo Posted December 26, 2006 Author Posted December 26, 2006 (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 December 26, 2006 by eHrgo Sorry for my Bad English.
Joon Posted December 26, 2006 Posted December 26, 2006 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.
eHrgo Posted December 26, 2006 Author Posted December 26, 2006 Hum..... im gonna use my first idea, copy files in a dir, and delete it..... Thanks Sorry for my Bad English.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now