miragez Posted January 21, 2008 Posted January 21, 2008 Hi to all prosI been searching the autoit forum for very long so far I been getting very little results of extracting archive with password in it.I tried this methodRunwait(@WorkingDir &'\7za.exe' & '" x ' & @Workingdir & '\testdoucment.7z'& "-p123456 -y -o" & '"' & @WorkingDir &'\zero' & '"')The compiler after compiling completed, I run it using F5 and it came out thiseE:\AutoIt3\test.au3 (9) : ==> Unable to execute the external program.: Runwait(@WorkingDir &'\7za.exe' & '" x ' & @Workingdir & '\testdoucment.7z'& "-p123456 -y -o" & '"' & @WorkingDir &'\zero' & '"') The filename, directory name, or volume label syntax is incorrect.I have all the folders in tact and ready to go but my method about does not work and the error message I do not understand I hope someone can help me out.cheersmirage
DW1 Posted January 21, 2008 Posted January 21, 2008 Just wrote this function up, it should work for you, password is optional: u7zip(@Workingdir & "\testdoucment.7z", @WorkingDir &'\zero', 123456 ) Func u7zip($archive, $dest, $pass = "") If $pass <> "" Then $pass = "-p" & '"' & $pass & '" ' RunWait(@WorkingDir &'\7za.exe' & ' x "' & $archive & '" ' & $pass & "-y -o" & '"' & $dest & '"') EndFunc AutoIt3 Online Help
miragez Posted January 21, 2008 Author Posted January 21, 2008 Thank you so much danwilliYou been a great help excellent reply I learn something new but do not understand will you tell me what does thisu7zip(@Workingdir & "\testdoucment.7z", @WorkingDir &'\zero', 123456 )means ? I am willing to listen to what you says because I love new concept and method And also whyIf $pass <> "" Then $pass = "-p" & '"' & $pass & '" 'What is this above code also means? is it very important ?RunWait(@WorkingDir &'\7za.exe' & ' x "' & $archive & '" ' & $pass & "-y -o" & '"' & $dest & '"')Will you mine sharing with me when do i put a '"' & variables & '"' and when do i put " " I kinda confused with ' ' and " " and also ' " '.Really sorry if I am asking too much I just want to learn more about it in autoit probably you can provide me to some resources which will directly help me answers those above questions.... I search the forum but not much was shown to help me understand clearly.By providing me the code its a easy steps but I hope to learn more about it thanks again.
DW1 Posted January 21, 2008 Posted January 21, 2008 This line is what calls the function u7zip() with three parameters = archive, destination, password(optional, noted by the $pass = "")u7zip(@Workingdir & "\testdoucment.7z", @WorkingDir &'\zero', 123456 )This line formats the $pass variable into the proper format: -p"pass" , but only if it was supplied (this way, the password is an optional variable, for 7zips that do not need a password too)If $pass <> "" Then $pass = "-p" & '"' & $pass & '" 'In order to figure out where all the '"', etc, need to go, I replaced the RunWait(<command>), with a MsgBox(0 "test", <command>), so that I could visually see, and debug, what was being passed to cmd.exeRunWait(@WorkingDir &'\7za.exe' & ' x "' & $archive & '" ' & $pass & "-y -o" & '"' & $dest & '"')Will you mine sharing with me when do i put a '"' & variables & '"' and when do i put " " I kinda confused with ' ' and " " and also ' " '. AutoIt3 Online Help
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