Re: Compressed (zipped) Folder - command line variant?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?
>
.



Relevant Pages

  • Re: copyhere problem
    ... Const noDialog = 4 'Do not display a progress dialog box ... Const displayProgress = 256 'Display a progress dialog box but do not show ... it's not giving me any problems creating the folder. ...
    (microsoft.public.scripting.vbscript)
  • [PATCH 15/19] TuxOnIce: Userspace user interface support.
    ... +static int userui_storage_needed ... * Side effect routine for when the userui program is set. ... * @value: Current progress percentage numerator. ... Whether to pause or just display the message. ...
    (Linux-Kernel)
  • Re: Where Have My e-Mail Contacts Gone?
    ... "Russ Valentine" wrote: ... It tells the address book view which folder to display as its default. ... When I type in ROBBIE in the search box all Robbies ...
    (microsoft.public.outlook.contacts)
  • Re: Where Have My e-Mail Contacts Gone?
    ... "Russ Valentine" wrote: ... It tells the address book view which folder to display as its default. ... When I type in ROBBIE in the search box all Robbies are ...
    (microsoft.public.outlook.contacts)
  • Re: Issues with media features on 360
    ... I'm running XP Pro with the Media ... By far the biggest issue is the perceived album name uniqueness. ... >>> have to display the year as well). ... When displaying pictures from the PC you start with folder names. ...
    (microsoft.public.windows.mediacenter)