Announcement

Collapse
No announcement yet.

script to unzip

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • script to unzip

    hey guys i have zip file's named "%username%s".zip in each users root directory that i need unzipped in their \%username%\my documents directory

    how can i script in server 2003 to unzip them using winrar to the my documents folder for each user
    Last edited by krayzie; 24th February 2009, 05:54. Reason: makes more sense

  • #2
    Re: script to unzip

    Originally posted by krayzie View Post
    how can i script 2003 to unzip them all in the my documents folder for each user
    Working with Zip files with no extra tools is quite hard, but there are ways to use Explorer's built-in compression. Here's a good page about archive handling: http://www.robvanderwoude.com/vbstech_files_zip.php

    -vP

    Comment


    • #3
      Re: script to unzip

      great read, bit confusing - i was thinking of using winrar to do the unziping of the files

      Comment


      • #4
        Re: script to unzip

        Originally posted by krayzie View Post
        i was thinking of using winrar to do the unziping of the files
        Is there an API available for WinRAR? As far as I know, there isn't one, so scripting Winrar requires a third-party tool like AutoIT.

        Anyway, you'd need just to uncompress the packet. As the Zip is located at each user's home directory, the easiest way is to unpack it during a logon script. Then you'd just check if %username%.zip is present, unzip it and delete the zip.

        Another a way would be a script that iterates each user's home directory and unzips the archive. The problem is, admin might not (and should not) have a read-write-change access to the user document directories. Logon script overcomes this limitation, as it is lauched with user's credentials.

        -vP

        Comment


        • #5
          Re: script to unzip

          that sounds like a great idea,

          so i create a batch file to run winrar in command line to pick up %username%.zip and dump it into c:\users\%username%\my documents\

          Comment


          • #6
            Re: script to unzip

            Its easy... Use 7-Zip command utility to unzip the file.

            You can include this code in VBScript.


            "C:\Program Files\7-Zip\7z.exe" X ZIPFILE.zip -aoa

            Comment

            Working...
            X