Sign in to follow this  
Followers 0
eekhoorn12

rar.exe problem

7 posts in this topic

#1 ·  Posted (edited)

I'm trying to make the code below with variables.

Run(rar a -v15000000b -m0 -ed -ep1 -df Variable1.rar "c:\Variable 2\*")

It is in rar.exe but it doesn't do what I want it to do because, if there is a space at varaible 2 it has to be between "" but then the intire code doesn't work. Somebody got the solution.

Rar.exe is provided with the post

Edited by eekhoorn12

Share this post


Link to post
Share on other sites



have you tried ' " " ' ?


Marius back in da hood! :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Run(rar a -v15000000b -m0 -ed -ep1 -df Variable1.rar "c:\Variable 2\*")

Try this:

RUN(rar & chr(34) & " a -v15000000b -m0 -ed -ep1 -df " & chr(34) & "Variable1.rar" & chr(34) & " " & chr(34) & "c:\Variable 2\*" & chr(34))

chr(34) = ASCII double-quote

Here's a function I wrote a while back that I use quite often:

_RunRar("D:\sourcedir\Somefile.rar","D:\sourcedir","C:\destinationdir")

Func _RunRAR($sFile,$sSourceDir,$sDestDir)
 
     $iPIDRAR = Run(Chr(34) & @ProgramFilesDir & "\Winrar\rar.exe" & Chr(34) & " x -y -o- " & Chr(34) & $sFile & Chr(34) & " " & Chr(34) & "*.*" & Chr(34) & " " & Chr(34) & $sDestDir & "\" & Chr(34), $sSourceDir & "\", @SW_HIDE)
 
         if ProcessExists($iPIDRAR) then
 
             ProcessWaitClose($iPIDRAR)
 
         Else
             SetError(1)
         EndIf
 
 EndFunc
Edited by TrystianSky

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I now have the following code:

#include <GUIConstants.au3>
 Global $Folder
 GUICreate ( "title" , 800 , 600 ); will create a dialog box that when displayed is centered
 
 GUICtrlCreateLabel ( "Invoer directory:", 10, 17 )
 $TITLE1 = GUICtrlCreateEdit($Folder, 110,  15, 325, 16, $ES_READONLY, $WS_EX_STATICEDGE)
 GUICtrlCreateLabel ( "Archief naam:", 10, 42 )
 $TITLE2 = GUICtrlCreateInput("", 110, 40, 100, 20)
;Creeer de bladeren knop
 $Bladeren = GUICtrlCreateButton ("Bladeren..",  440, 10, 70)
 $Start = GUICtrlCreateButton ("Start",  60, 120, 50)
 
 $ArchiefNaam = GUICtrlRead($TITLE2)
 
 GUISetState (@SW_SHOW)
 While 1
     $msg = GUIGetMsg()
        Select
         Case $MSG = $GUI_EVENT_CLOSE
             Exit
         Case  $msg = $Bladeren
             $Folder = FileSelectFolder("Kies de map.", "")
             If @error Then ContinueLoop 
             GUICtrlSetData($TITLE1, $Folder)
         Case $msg = $Start
             $a = Run("rar a -v15000000b -m0 -ed -ep1 -df " & chr(34) & $Folder & "\" & $ArchiefNaam & ".rar" & chr(34) & " " & chr(34) & $Folder & "\*" & chr(34)) 
             msgbox(0, "test", $ArchiefNaam)
     EndSelect
 Wend

But when I press the start button, the msgbox doestn't show $Archiefnaam, But when I replace $archiefnaam with GUICtrlRead($TITLE2) at the msgbox it does show what is typed at the input

Edited by eekhoorn12

Share this post


Link to post
Share on other sites

I now have the following code:

But when I press the start button, the msgbox doestn't show $Archiefnaam, But when I replace $archiefnaam with GUICtrlRead($TITLE2) at the msgbox it does show what is typed at the input

That is correct, because the "$ArchiefNaam = GUICtrlRead($TITLE2)" line is at the wrong place.

You read the value of the $TITLE2 control before the GUI is displayed and anything is typed.

Move this line inside the While...Wend loop after "Case $msg = $Start" ..


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I think it would be wise to remove the Rar.exe attached if it is a paid for executable. Rar.exe is not freeware.

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