Sign in to follow this  
Followers 0
E1M1

Unpack *.rar?

6 posts in this topic

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



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


[size="5"] [/size]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

thanks


edited

Share this post


Link to post
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

Share this post


Link to post
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

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