$ sign and other special chars when extracting

Help
2013-05-29
2013-07-16
  • L. Bengtsson

    L. Bengtsson - 2013-05-29

    Hi 7Zip help forum ;-)

    I'm currently writing a PowerShell script that integrates 7Zip for easy De-compression of archives.
    During my tests I stumbled upon an archive with a $ sign in both the archive name and in the file names inside the archive.

    I have searched the forum, Googled and read the 7Zip help file as well as the FAQ on the 7Zip homepage, but with no luck in finding a solution.

    Interestingly I can De-compress the file if I use the GUI but I cannot when I use the cmdline (this is also what the PowerShell script uses).

    Do anyone know if this is a bug or if not how I might fix this?

    Looking forward to your answers.

    Thank you very much in advance.
    /YeahBuddy

     
  • L. Bengtsson

    L. Bengtsson - 2013-06-05

    Anyone with a suggestion? Please let me know if something needs to be outlined and further explained.

    Thank you.
    /YeahBuddy

     
  • fernando

    fernando - 2013-06-10
    $ cd /d z:
    
    $ md $directory$
    
    $ rem.> $directory$\$file$
    
    $ 7z a $archive$ $directory$
    
    7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    Scanning
    
    Creating archive $archive$.7z
    
    Everything is Ok
    
    $ 7z x $archive$.7z -o$dir$
    
    7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    
    Processing archive: $archive$.7z
    
    Extracting  $directory$\$file$
    Extracting  $directory$
    
    Everything is Ok
    
    Folders: 1
    Files: 1
    Size:       0
    Compressed: 144
    
    $ path=E:\Program Files\7-Zip;%path%
    
    $ 7za x $archive$.7z -o%dir2$
    
    7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    
    Processing archive: $archive$.7z
    
    Extracting  $directory$\$file$
    Extracting  $directory$
    
    Everything is Ok
    
    Folders: 1
    Files: 1
    Size:       0
    Compressed: 144
    
    $ dir/b/s
    Z:\$directory$
    Z:\$archive$.7z
    Z:\$dir$
    Z:\%dir2$
    Z:\$directory$\$file$
    Z:\$dir$\$directory$
    Z:\$dir$\$directory$\$file$
    Z:\%dir2$\$directory$
    Z:\%dir2$\$directory$\$file$
    
    $
    
     
  • fernando

    fernando - 2013-06-10

    I do not know PS language.
    Maybe below will help?

    PS Z:\> $command='c:\bin\7z.exe'
    PS Z:\> $switch='x'
    PS Z:\> $archive='$archive$.7z'
    PS Z:\> &$command "$switch" "$archive"
    
    7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
    
    Processing archive: $archive$.7z
    
    Extracting  $directory$\$file$
    Extracting  $directory$
    
    Everything is Ok
    
    Folders: 1
    Files: 1
    Size:       0
    Compressed: 144
    PS Z:\>
    
     
    • L. Bengtsson

      L. Bengtsson - 2013-06-14

      Hi Fernando,

      Thank you very much for replying. I will try what you are describing. I will get back ;-)

      Regards!

       
    • L. Bengtsson

      L. Bengtsson - 2013-07-16

      Hi Fernando,

      Again thank you for your help. It was basically the ticks (' ') that did it. I guess that 7zip do not like quotes (") in the cmdline. Now it is working with $,!,# and so forth.

      Appreciate your help.

      Regards
      /Lars B.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks