Jump to content
Sign in to follow this  
E1M1

Unpack *.rar?

Recommended Posts

E1M1

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?


edited

Share this post


Link to post
Share on other sites
Fire

Here is: http://www.autoitscript.com/forum/index.php?showtopic=107377


[size="5"] [/size]

Share this post


Link to post
Share on other sites
James

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

Share this post


Link to post
Share on other sites
jvanegmond

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

Share this post


Link to post
Share on other sites
James

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.