command line extract

  • Thread starter Thread starter Neal Makely
  • Start date Start date
N

Neal Makely

Does anyone know if Windows XP has any command line utilities to handle
compressed (zip) files? I have a large database file that I need to copy to
the C: drive from a CD. I'm trying to keep the process as simple as
possible for the end user, so I'd like to copy a zipped version of the file,
then extract it with a batch file.

Here's the scenario:
backup.zip (@50MB) on CD
Batch file copies backup.zip to C:\temp, extracts backup.db from backup.zip

Can it be done? I'm trying to keep it simple and avoid any third-party apps
(free or not) or make any assumptions that the end-user has WinZip or
something similar installed.

Thanks.
Neal Makely
 
Neal Makely said:
Does anyone know if Windows XP has any command line utilities to handle
compressed (zip) files? I have a large database file that I need to copy to
the C: drive from a CD. I'm trying to keep the process as simple as
possible for the end user, so I'd like to copy a zipped version of the file,
then extract it with a batch file.

Here's the scenario:
backup.zip (@50MB) on CD
Batch file copies backup.zip to C:\temp, extracts backup.db from backup.zip

Can it be done? I'm trying to keep it simple and avoid any third-party apps
(free or not) or make any assumptions that the end-user has WinZip or
something similar installed.

Thanks.
Neal Makely

Yes, it can be done, using the COMPACT command. Type in "Compact /?" from
the command prompt for more info.

HTH HAND
 
You can only write a script. You must use Shell functions not file functions.

Set objShell = CreateObject("Shell.Application")
Set DestFldr=objShell.NameSpace(&H0)
Set SrcFldr=objShell.NameSpace("C:\Documents and Settings\David Candy\Desktop\DefaultMail.zip")
Set FldrItems=SrcFldr.Items
DestFldr.CopyHere FldrItems

I copying the entire contents of the zip maintaining directory structure

The destination folder can be hard coded like source or one of the following. EG C's 0x0000 is vbscript's &H0 - this is BASE 16 - 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, 10 (=16), 11, ..., 19, 1a, 1b, 1c, 1d, 1e, 20 (=32).
typedef enum {
CSIDL_DESKTOP = 0x0000,
CSIDL_INTERNET = 0x0001,
CSIDL_PROGRAMS = 0x0002,
CSIDL_CONTROLS = 0x0003,
CSIDL_PRINTERS = 0x0004,
CSIDL_PERSONAL = 0x0005,
CSIDL_FAVORITES = 0x0006,
CSIDL_STARTUP = 0x0007,
CSIDL_RECENT = 0x0008,
CSIDL_SENDTO = 0x0009,
CSIDL_BITBUCKET = 0x000A,
CSIDL_STARTMENU = 0x000B,
CSIDL_MYDOCUMENTS = 0x000C,
CSIDL_MYMUSIC = 0x000D,
CSIDL_MYVIDEO = 0x000E,
CSIDL_DESKTOPDIRECTORY = 0x0010,
CSIDL_DRIVES = 0x0011,
CSIDL_NETWORK = 0x0012,
CSIDL_NETHOOD = 0x0013,
CSIDL_FONTS = 0x0014,
CSIDL_TEMPLATES = 0x0015,
CSIDL_COMMON_STARTMENU = 0x016,
CSIDL_COMMON_PROGRAMS = 0x0017,
CSIDL_COMMON_STARTUP = 0x0018,
CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019,
CSIDL_APPDATA = 0x001A,
CSIDL_PRINTHOOD = 0x001B,
CSIDL_LOCAL_APPDATA = 0x001C,
CSIDL_ALTSTARTUP = 0x001D,
CSIDL_COMMON_ALTSTARTUP = 0x001E,
CSIDL_COMMON_FAVORITES = 0x001F,
CSIDL_INTERNET_CACHE = 0x0020,
CSIDL_COOKIES = 0x0021,
CSIDL_HISTORY = 0x0022,
CSIDL_COMMON_APPDATA = 0x0023,
CSIDL_WINDOWS = 0x0024,
CSIDL_SYSTEM = 0x0025,
CSIDL_PROGRAM_FILES = 0x0026,
CSIDL_MYPICTURES = 0x0027,
CSIDL_PROFILE = 0x0028,
CSIDL_SYSTEMX86 = 0x0029,
CSIDL_PROGRAM_FILESX86 = 0x002A,
CSIDL_PROGRAM_FILES_COMMON = 0x002B,
CSIDL_PROGRAM_FILES_COMMONX86 = 0x002C,
CSIDL_COMMON_TEMPLATES = 0x002D,
CSIDL_COMMON_DOCUMENTS = 0x002E,
CSIDL_COMMON_ADMINTOOLS = 0x002F,
CSIDL_ADMINTOOLS = 0x0030,
CSIDL_CONNECTIONS = 0x0031,
CSIDL_COMMON_MUSIC = 0x0035,
CSIDL_COMMON_PICTURES = 0x0036,
CSIDL_COMMON_VIDEO = 0x0037,
CSIDL_RESOURCES = 0x0038,
CSIDL_RESOURCES_LOCALIZED = 0x0039,
CSIDL_COMMON_OEM_LINKS = 0x003A,
CSIDL_CDBURN_AREA = 0x003B,
CSIDL_COMPUTERSNEARME = 0x003D,
CSIDL_FLAG_PER_USER_INIT = 0x0800,
CSIDL_FLAG_NO_ALIAS = 0x1000,
CSIDL_FLAG_DONT_VERIFY = 0x4000,
CSIDL_FLAG_CREATE = 0x8000,
CSIDL_FLAG_MASK = 0xFF00
} CSIDL Values;
 
Back
Top