Gerald Posted June 30, 2009 Posted June 30, 2009 can i extract winrar flie using autoit script plss post your code
Developers Jos Posted June 30, 2009 Developers Posted June 30, 2009 (edited) Gerald said: can i extract winrar flie using autoit scriptJust run winrar as a commandline using Run(). Gerald said: plss post your codeGive it a try first yourself. Edited June 30, 2009 by Jos 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.
Inverted Posted June 30, 2009 Posted June 30, 2009 WinRar comes with the commandline tool "Rar.exe" ! Use that
Gerald Posted July 1, 2009 Author Posted July 1, 2009 Run("WinRAR X LETTERS.RAR LETTER.TXT c:\work\misc") this is my code i got the WinRAR X LETTERS.RAR LETTER.TXT c:\work\misc in to Winrar command line but wen i run the cod they do nothing plss help me show your Ex. Code ASP
Inverted Posted July 1, 2009 Posted July 1, 2009 You can't just run winrar from wherever, it's not in the path. You need the full path to the exe. Also, I'd first try using the commandline utility rar.exe instead of the normal winrar.exe Example : Run (@ProgramFilesDir & "\rar.exe your_parameters_here")
Gerald Posted July 2, 2009 Author Posted July 2, 2009 Run (@ProgramFilesDir & "\rar.exe WinRAR X LETTERS.RAR LETTER.TXT c:\work\misc") ok i do this but there is noting to do give me a Example code ......psssss
Inverted Posted July 2, 2009 Posted July 2, 2009 (edited) From a dos prompt you can run rar.exe and see its parameters. Correct command is : Run (@ProgramFilesDir & "\rar.exe x c:\whatever\LETTERS.RAR LETTER.TXT c:\work\misc") You should use the full path to the rar file, for ease of use. Edited July 2, 2009 by Inverted
Inverted Posted July 6, 2009 Posted July 6, 2009 Gerald said: how can i run rar.exe in dos prompt ..?start > run > cmd , then press enter, and in the dosprompt execute these commands :cd %ProgramFiles%cd winrarrarAnd see the help.
happy2help Posted July 7, 2009 Posted July 7, 2009 i use this code expandcollapse popup#Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\Batch files\Icons\RARX.ico #AutoIt3Wrapper_Compression=4 #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** #include <UnRAR.au3> #include <File.au3> #include <Array.au3> Local $ArchiveFile[1] Global $Cancel = False HotKeySet("{Esc}", "_CancelUnpack") $copy1 = FileInstall("C:\Users\Public\Backup\Batch files\Install Files\unrar.dll", "unrar.dll", 1) $oFolder = "H:\To Burn\To Laptop\" If Not FileExists($oFolder) Then $oFolder = "D:\Laptop\Unpacked\"; set for testing purposes $iFolder = "H:\To Burn\" If Not FileExists($iFolder) Then $iFolder = "D:\Laptop\Unpacked\"; set for testing purposes $OutputFolder = FileSelectFolder("Browse for output path", $oFolder, 1) If $OutputFolder = "" Then Exit ; if its cancelled then exit script $InputFolder = FileSelectFolder("Browse for output path", $iFolder, 1) If $InputFolder = "" Then Exit ; if its cancelled then exit script $ArchiveFile[0] = FileOpenDialog("Select the archive file", $InputFolder, "Archive files (*.rar)") Do $ask = FileOpenDialog("Select the archive file", $InputFolder, "Archive files (*.rar)") if $ask = "" Then ExitLoop ; if its cancelled then no more files to add _ArrayAdd($ArchiveFile, $ask) Until False ; Read in lines of text until the EOF is reached For $x=0 To Ubound($ArchiveFile)-1 ;Creates a user-defined DLL Callback function to process Unrar events $hUnRAR_CallBack = DllCallbackRegister("_UnRARProc", "int", "uint;int;int;int") ;Open RAR archive and allocate memory structures $hArchive = _RAR_OpenArchive($ArchiveFile[$x]) If @error Then MsgBox(16, @error, "Archive open error") Exit EndIf $hArchive = _RAR_OpenArchive($ArchiveFile[$x]) If @error Then MsgBox(16, "UnRAR", "Archive open error") Exit EndIf ;Set a user-defined callback function to process Unrar events _RAR_SetCallback($hArchive, $hUnRAR_CallBack) ;Read header of file in archive, performs action and moves the current position in the archive to the next file ;Also extract or test the current file from the archive $result = StringTrimLeft($ArchiveFile[$x], 20) $OutputFolder1 = $OutputFolder & "\" & @HOUR & @MIN SplashTextOn("Unpacking Now", "Unpacking " & $result & @CRLF & @CRLF & "Please wait a while." & @CRLF & @CRLF & $OutputFolder1, 800, 180) _Rar_UnpackArchive($hArchive, $OutputFolder1) If @error Then MsgBox(16, "UnRAR", "Archive unpacking error") Exit EndIf SplashOff() If $Cancel = True Then MsgBox(64, "UnRAR", "Unpacking cancelled") Else MsgBox(64, "Done", "Archive unpacked",2) EndIf DllCallbackFree($hUnRAR_CallBack) Next Func _CancelUnpack() $Cancel = True EndFunc ;==>_CancelUnpack Func _UnRARProc($Msg, $UserData, $P1, $P2) Switch $Msg Case $UCM_PROCESSDATA;Return a positive value to continue process or -1 to cancel the archive operation If $Cancel = True Then Return -1 Case $UCM_NEEDPASSWORD;DLL needs a password to process archive Local $iPassGet = InputBox("Password required", "Please type a password", "", "*", 300, 120) If $iPassGet = "" Then Return -1;If user cancelled password entering Local $PassBuffer = DllStructCreate("char[256]", $P1) DllStructSetData($PassBuffer, 1, $iPassGet) Return 1 Case $UCM_CHANGEVOLUME;Process volume change If $P2 = $RAR_VOL_ASK Then;Required volume is absent Local $iVolGet = InputBox("Next volume required", "Please type a path to the next volume", "", "", 300, 120) If $iVolGet = "" Then Return -1;If user cancelled path entering Local $VolBuffer = DllStructCreate("char[256]", $P1) DllStructSetData($VolBuffer, 1, $iVolGet) Return 1 EndIf EndSwitch EndFunc ;==>_UnRARProc you need to search the forum for unrar.au3
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