DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Idea: Zip as a drive  (Read 15,642 times)

Nuri

  • Participant
  • Joined in 2005
  • *
  • Posts: 17
Idea: Zip as a drive
« on: July 27, 2005, 09:52 PM »
I frequently need to work with lot of small files to transfer them easily i zip them together.
I would like a plugin for total commander or a stand alone program wich treats a zip file as a virtual drive.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
DONE: Zip as a drive
« Reply #1 on: August 01, 2005, 01:07 AM »
:) Here's a very quick hack, so be careful no to delete any of your zip files.

DriveZip creates a virtual drive from a zip file. It asks for a zip file, expands it and substs it to create a virutal drive and opens it in Explorer. Now you can add and remove files from it. It then asks if you want to recompress the zip file or cancel.

Installation:
1: Download and install AutoHotKey from www.autohotkey.com.
2: Create a folder called DriveZip in your programs folder and save the script below as DriveZip.ahk in there.
3: Download www.freebyte.com/download/fbzpack.exe and extract the file FBZip.exe to the DriveZip folder.

Skrommel


Code
;DriveZip.ahk
;Creates a virtual drive from a zip file
;Skrommel @2005

FINDDRIVE:
DriveGet,list,List
drive=67
Loop,24
{
  Transform,zipdrive,Chr,%drive%
  IfNotInString,list,%zipdrive%
    Break
  drive+=1
}
If drive=91
{
  MsgBox,0,DriveZip,No available drive letters
  ExitApp
}

SELECT:
FileSelectFile,zipfile,3,,Select the ZIP-file, ZIP-files (*.zip)
If zipfile=
{
  MsgBox,1,DriveZip,No file selected. Quit?
  IfMsgBox,OK
    ExitApp
  Goto,SELECT
}

EXTRACT:
RunWait,fbzip -e -p "%zipfile%" "%A_WorkingDir%\%zipdrive%"
RunWait,Subst %zipdrive%: "%A_WorkingDir%\%zipdrive%"
FileAppend,%A_WorkingDir%\%zipdrive%\DriveZip.ini,
Run,Explorer /e`,%zipdrive%:\

CANCEL:
Sleep,1000
MsgBox,1,DriveZip,ZIP-file extracted to %zipdrive%:`n`nPress OK to Recompress`nPress Cancel to clean up and Quit
IfMsgBox,Cancel
{
  FileRemoveDir, %A_WorkingDir%\%zipdrive%, 1
  Run,Subst %zipdrive%: /d
  ExitApp
}

COMPRESS:
FileDelete, %zipfile%
RunWait,fbzip -a -r -p "%zipfile%" "%zipdrive%:\"
FileRemoveDir, %A_WorkingDir%\%zipdrive%, 1
Run,Subst %zipdrive%: /d
ExitApp

Nuri

  • Participant
  • Joined in 2005
  • *
  • Posts: 17
Re: Idea: Zip as a drive
« Reply #2 on: August 01, 2005, 06:59 AM »
Thanks!

Original address: https://www.donationcoder.com/forum/index.php?topic=628.0