borsve Posted April 16, 2007 Share Posted April 16, 2007 Hi everybody,i'm as new as new can get to autoit. I'm working on a script that is supposed to download un update from internet, than unrar it and than copy the files to their intended directory in a certain order.I did research on this forum and was able to find how to download the update form the internet CODEDirCreate ("the directory")#include <Inet.au3>$sSource = _INetGetSource("the web site")$aArray = StringRegExp($sSource, '(?s)(?i)\<A HREF\="(\d{8}-\d{3}-i32\.exe)"', 3)If IsArray($aArray) Then InetGet("the web site" & $aArray[uBound($aArray) - 1], "the directory" & $aArray[uBound($aArray) - 1])this is working just fine, since it was easy to understand how to adjust it to do what i wanted it to do on my computer.Now my question is about the next part of the script where its supposed to unrar the file:CODERun (@COMSPEC & " /c " & '"' & "start " & "C:\Program Files\WinRAR\winrar.exe" & " x " & "-o- " & "-- " & "C:\Program Files\WinRAR\rar.exe" & "C:\Documents and Settings\user\Desktop\temp\thefile.rar" & " " & "C:\Documents and Settings\user\Desktop\temp\") do sleep(2500) until ProcessExists ( "rar.exe" ) = 0the problem is when it gets to reading "C:\Program Files\WinRAR\winrar.exe" it gives an eror saying: "Windows cannot find 'c:\Program'. Make sure you typed the name correctly and than try again."Can anybody tell me what is wrong with this string of code and whether it will do what i think it should.I ask this because i extractet this part of the code from WhiteCrows script (thank you to white crow http://www.autoitscript.com/forum/index.ph...5&hl=winrarbut i do not completely understand what the code means, so i was just trying to figure it out for my self.Please pardon my english it is not my native language,and i'm thankfull for all the help that i might get.Boris. Link to comment Share on other sites More sharing options...
alex OF DEATH Posted April 16, 2007 Share Posted April 16, 2007 (edited) The problem is that there is a space between program and files, so it stops reading the string after 'program'. Use "@ProgramFilesDir" It would look like this: Run (@COMSPEC & " /c " & '"' & "start " & "@ProgramFilesDir\WinRAR\winrar.exe" & " x " & "-o- " & "-- " & "@ProgramFilesDir\WinRAR\rar.exe" & "@DocumentsCommonDir\user\Desktop\temp\thefile.rar" & " " & "@DocumentsCommonDir\user\Desktop\temp\") I also added the @DocumentsCommonDir because that would have made problems too. Tell me if it works, and good luck. edit: changed @MyDocumentsDir to @DocumentsCommonDir Edited April 16, 2007 by alex OF DEATH Link to comment Share on other sites More sharing options...
borsve Posted April 16, 2007 Author Share Posted April 16, 2007 Thanks for the advice, Alex but unfortunately it still dosen't work. Now it gives the same eror message only it says it can't find "@ProgramFilesDir\WinRAR\winrar.exe"i even tryend it withiut Dir in the path but it still cant find itAny ideas?The problem is that there is a space between program and files, so it stops reading the string after 'program'.Use "@ProgramFilesDir"It would look like this: Run (@COMSPEC & " /c " & '"' & "start " & "@ProgramFilesDir\WinRAR\winrar.exe" & " x " & "-o- " & "-- " & "@ProgramFilesDir\WinRAR\rar.exe" & "@DocumentsCommonDir\user\Desktop\temp\thefile.rar" & " " & "@DocumentsCommonDir\user\Desktop\temp\")I also added the @DocumentsCommonDir because that would have made problems too.Tell me if it works, and good luck.edit: changed @MyDocumentsDir to @DocumentsCommonDir Link to comment Share on other sites More sharing options...
smashly Posted April 16, 2007 Share Posted April 16, 2007 (edited) It's not the @ProgramFilesDir and macros being needed , it's the placement of quotes..... Run (@COMSPEC & ' /c ' & '""' & 'start ' & '"C:\Program Files\WinRAR\winrar.exe"' & ' x -o- -- ' & '"C:\Program Files\WinRAR\rar.exe"' & '"C:\Documents and Settings\user\Desktop\temp\thefile.rar"' & ' ' & '"C:\Documents and Settings\user\Desktop\temp\"')oÝ÷ Ø ÝjÇ讫¨µâ-Â¥vZ(X¤zØb±§ãº ©W¬*ô÷e¢ÓÝ«j·±z«¨µ©©ªê-.éí°*&ý=Úë¯Ov ë$¶t÷k^=ÚØ^~)^ªêºZ®¢Ú®¢Ö¦¦«¨´:ºg§¶À¨j'*ô÷k¬z½=Ø7¬Ú)ÓÝzjt÷j®¢ßêº^¬z+l¥u·¦¢·¥GºÚ"µÍ[ ÓÓTÔPÈ [È ÌÎNÈØÈ ÌÎNÈ [È ÌÎNÉ][ÝÉ][ÝÉÌÎNÈ [È ÌÎNÜÝ ÌÎNÈ [È ÌÎNÉ][ÝÉÌÎNÈ [ÈÙÜ[Q[Ñ [È ÌÎNÉÌLÕÚ[TÌLÝÚ[^I][ÝÉÌÎNÈ [È ÌÎNÈ[ËHKH ÌÎNÈ [È ÌÎNÉ][ÝÉÌÎNÈ [ÈÙÜ[Q[Ñ [È ÌÎNÉÌLÕÚ[TÌLÜ^I][ÝÉÌÎNÈ [È ÌÎNÉ][ÝÉÌÎNÈ [ÈÚÝÜÛÛ[[Û [È ÌÎNÉÌLÝ[ ÌLÝY[K][ÝÉÌÎNÈ [È ÌÎNÈ ÌÎNÈ [È ÌÎNÉ][ÝÉÌÎNÈ [ÈÚÝÜÛÛ[[Û [È ÌÎNÉÌLÝ[ ÌLÉ][ÝÉÌÎNÊ Not say what I've typed will work, but it will run and return >Exit code: 0 in scite if the paths are true.. Cheers Edited April 16, 2007 by smashly Link to comment Share on other sites More sharing options...
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