Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

extracting with encrypted password not working in batch

Help
jsauce
2014-08-16
2014-08-23
  • jsauce
    jsauce
    2014-08-16

    I have tried it every which way, when I try to use either 7z.exe or 7zg.exe, if I type it manually in the command line: 7z.exe x whatever.7z -pjsauceistheman!1 it extracts fine.

    If i do the same thing in a batch file, it errors: Can not open encrypted archive. Wrong Password?

    What gives, seems kind of weird to me. I've tried with the GUI 7zg and 7z

    I was originally trying to something more extensive like this in the batch file but it wouldn't work, and then I tested the basic and it also wouldn't work, however both work when manually typed in.

    7zG.exe x -pjsauceistheman!1 -o"c:\whatever\Library" -y -t7z whatever.bin *
    7z.exe x -pjsauceistheman!1 -o"c:\whatever\Library" -y -t7z whatever.bin *

    The whatever.bin is a 7zip archive with an encrypted password, however I've tried this with a normal 7zip test archive with an encrypted password, and it works when i type it in, doesn't work if i add it to a batch file.

     
  • Igor Pavlov
    Igor Pavlov
    2014-08-17

    Probably ! is the problem.
    It can be escape sequence.

     
  • jsauce
    jsauce
    2014-08-23

    So there is no way to fix that without changing the password? I tried putting quotes around the password and no go.

     
  • jsauce
    jsauce
    2014-08-23

    Nevermind you were right, I just used the escape and it worked perfectly. Thank you so much.