Sign in to follow this  
Followers 0
spanga

Unraring and running dos commands

5 posts in this topic

#1 ·  Posted (edited)

Hi.

I got a script that download a file from my webserver. Then it is supposed to unrar the file it has downloaded.

I though "piece of cake", but now I am banging my head after trying everything I know of, it just wont work...

Here is an example of what I tried:

RunWait(@ComSpec & " /C " & @ScriptDir & "\unrar.exe x therarfile.rar >ee.txt", "", @SW_HIDE)

The funny thing is that when I do this on my own computer it works, but when copying the compiled executable to my other computer it will download the file and so on but it wont extract. I also tried putting the unrar commands in a bat file and then run:

Run("exec.bat","",@SW_HIDE)

The bat file works when double-clicking on it.

Same result. Works on my computer, but no one elses.

Anyone know what could be wrong or know another way of unpacking the file?

Edited by spanga

Share this post


Link to post
Share on other sites



Hi.

I got a script that download a file from my webserver. Then it is supposed to unrar the file it has downloaded.

I though "piece of cake", but now I am banging my head after trying everything I know of, it just wont work...

Here is an example of what I tried:

RunWait(@ComSpec & " /C " & @ScriptDir & "\unrar.exe x therarfile.rar >ee.txt", "", @SW_HIDE)

The funny thing is that when I do this on my own computer it works, but when copying the compiled executable to my other computer it will download the file and so on but it wont extract. I also tried putting the unrar commands in a bat file and then run:

Run("exec.bat","",@SW_HIDE)

The bat file works when double-clicking on it.

Same result. Works on my computer, but no one elses.

Anyone know what could be wrong or know another way of unpacking the file?

Does the other computers have unrar.exe, if not you will have to use FileInstall to send it with the script


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Does the other computers have unrar.exe, if not you will have to use FileInstall to send it with the script

Yes, all computer download unrar.exe, which does not need to be installed since it works if I manually run the bat command. The problem lies were auto-it gets the task to run the bat file or the unrar.exe, I am pretty sure of.

Share this post


Link to post
Share on other sites

try setting the working dir.

Thought I already tried that, obviously not :">

Thanks alot!

Now working:

RunWait(@ComSpec & " /C " & @ScriptDir & "\unrar.exe x test.rar >rarlog.txt", @scriptdir & "\", @SW_HIDE)

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