eekhoorn12 Posted November 18, 2005 Posted November 18, 2005 (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 November 19, 2005 by eekhoorn12
Marius Posted November 18, 2005 Posted November 18, 2005 have you tried ' " " ' ? Marius back in da hood! :)
w0uter Posted November 18, 2005 Posted November 18, 2005 try something like: Run("rar a -v15000000b -m0 -ed -ep1 -df " & $Variable1 & '.rar "c:\' & $Variable2 & '\*"') My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Trystian Posted November 18, 2005 Posted November 18, 2005 (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 November 18, 2005 by TrystianSky
eekhoorn12 Posted November 19, 2005 Author Posted November 19, 2005 (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 November 19, 2005 by eekhoorn12
Developers Jos Posted November 19, 2005 Developers Posted November 19, 2005 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" .. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
MHz Posted November 19, 2005 Posted November 19, 2005 I think it would be wise to remove the Rar.exe attached if it is a paid for executable. Rar.exe is not freeware.
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