Jump to content

Unpack *.rar?


E1M1
 Share

Recommended Posts

How to make script that unpacks rar file? I searched from example scripts and found 7zip udf that works nice but it didn't work with rar files, can you recommend me something?

Download unrar.exe into your script directory.

Add this function to your code:

Func _Extract($sArchive, $sLocation)
    $myExtract = Run(@ScriptDir & "\UnRAR.exe x " & $sArchive & " " & $sLocation, @ScriptDir, @SW_HIDE, 0x2)
    While 1
        $extLine = StdoutRead($myExtract)
        If @error Then
            ExitLoop
        EndIf
    WEnd
EndFunc

Also, this function is written by me, for AutoAV (making it easier to search for now ;))

Edited by JamesBrooks
Link to comment
Share on other sites

Add this function to your code:

Func _Extract($sArchive, $sLocation)
    $myExtract = Run(@ScriptDir & "\UnRAR.exe x " & $sArchive & " " & $sLocation, @ScriptDir, @SW_HIDE, 0x2)
    While 1
        $extLine = StdoutRead($myExtract)
        If @error Then
            ExitLoop
        EndIf
    WEnd
EndFunc

Also, this function is written by me, for AutoAV (making it easier to search for now ;))

James, I find it a little bit weird that you are getting data from the out stream, instead of just using RunWait or checking if the process still exists.. And also

omglul you shard sum code from autoav

Link to comment
Share on other sites

James, I find it a little bit weird that you are getting data from the out stream, instead of just using RunWait or checking if the process still exists.. And also

omglul you shard sum code from autoav

The reason it was coming out of the stream was so that I could check everything was going through, I never did get round to changing that.

Sharing code? Posted Image

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...