Re: Compressed (zipped) Folder - command line variant?
- From: "Tempest261" <Tempest261@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Jun 2005 11:19:05 -0700
Awesome! Thanks. I'll give that a try.
"David Candy" wrote:
> This script extracts files from a zip passed on the command line and makes a folder on the desktop with the contents. Just do reverse to zip. A new zip file is easly created (look at a new one - it's 14 bytes of mostly null but starting PK). This uses Shell commands rather than File commands. We are working with shell objects that merely happen to be files.
>
> Set objShell = CreateObject("Shell.Application")
> Set Ag=Wscript.Arguments
> set WshShell = WScript.CreateObject("WScript.Shell")
>
>
> Set DestFldr=objShell.NameSpace(Ag(1))
> Set SrcFldr=objShell.NameSpace(Ag(0))
> Set FldrItems=SrcFldr.Items
> DestFldr.CopyHere FldrItems, &H214
>
>
> I specified options of 0x214 (&h214) in hex. 200 + 10 + 4, change to suit your purposes.
>
> Private Const FO_MOVE As Long = &H1
> Private Const FO_COPY As Long = &H2
> Private Const FO_DELETE As Long = &H3
> Private Const FO_RENAME As Long = &H4
>
> Private Const FOF_MULTIDESTFILES As Long = &H1
> Private Const FOF_CONFIRMMOUSE As Long = &H2
> Private Const FOF_SILENT As Long = &H4
> Private Const FOF_RENAMEONCOLLISION As Long = &H8
> Private Const FOF_NOCONFIRMATION As Long = &H10
> Private Const FOF_WANTMAPPINGHANDLE As Long = &H20
> Private Const FOF_CREATEPROGRESSDLG As Long = &H0
> Private Const FOF_ALLOWUNDO As Long = &H40
> Private Const FOF_FILESONLY As Long = &H80
> Private Const FOF_SIMPLEPROGRESS As Long = &H100
> Private Const FOF_NOCONFIRMMKDIR As Long = &H200
>
> FlagDescription
> FOF_ALLOWUNDO Preserve Undo information, if possible. If pFrom does not contain fully qualified path and file names, this flag is ignored.
> FOF_CONFIRMMOUSENot currently used.
> FOF_FILESONLY Perform the operation on files only if a wildcard file name (*.*) is specified.
> FOF_MULTIDESTFILES The pTo member specifies multiple destination files (one for each source file) rather than one directory where all source files are to be deposited.
> FOF_NOCONFIRMATION Respond with "Yes to All" for any dialog box that is displayed.
> FOF_NOCONFIRMMKDIR Do not confirm the creation of a new directory if the operation requires one to be created.
> FOF_NO_CONNECTED_ELEMENTSVersion 5.0. Do not move connected files as a group. Only move the specified files.
> FOF_NOCOPYSECURITYATTRIBSVersion 4.71. Do not copy the security attributes of the file.
> FOF_NOERRORUI Do not display a user interface if an error occurs.
> FOF_NORECURSIONOnly operate in the local directory. Don't operate recursively into subdirectories.
> FOF_RECURSEREPARSERecurse into reparse points. The default is to not recurse.
> FOF_NORECURSEREPARSETreat reparse points as objects, not containers. You must set _WIN32_WINNT to 5.01 or later to use this flag. See Shell and Common Controls Versions for further discussion of versioning.
> FOF_RENAMEONCOLLISION Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
> FOF_SILENT Do not display a progress dialog box.
> FOF_SIMPLEPROGRESS Display a progress dialog box but do not show the file names.
> FOF_WANTMAPPINGHANDLE If FOF_RENAMEONCOLLISION is specified and any files were renamed, assign a name mapping object containing their old and new names to the hNameMappings member.
> FOF_WANTNUKEWARNINGVersion 5.0. Send a warning if a file is being destroyed during a delete operation rather than recycled. This flag partially overrides FOF_NOCONFIRMATION.
>
>
>
>
>
> --
> --------------------------------------------------------------------------------------------------
> http://webdiary.smh.com.au/archives/_comment/001075.html
> =================================================
> "Tempest261" <Tempest261@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:603740A2-288A-4FE5-BCD4-FD1AC82C6298@xxxxxxxxxxxxxxxx
> > Is there any way to create a zipped folder from the command line? "Compact"
> > doesn't really do what I want (just uses drivespace or something to compress
> > the folder).
> >
> > What I'm trying to do is make a simple batch file that creates a folder,
> > throws a bunch of files with the same extenstion into it, and then zips it
> > up- but without a command line version of the built-in windows zip program
> > this will be impossible (through batch file anyway). Any ideas?
>
.
- References:
- Compressed (zipped) Folder - command line variant?
- From: Tempest261
- Compressed (zipped) Folder - command line variant?
- Prev by Date: Re: Windows Explorer Search ignores some file types?
- Next by Date: Add printer with batch file
- Previous by thread: RE: Compressed (zipped) Folder - command line variant?
- Next by thread: Re: Compressed (zipped) Folder - command line variant?
- Index(es):
Relevant Pages
|