VG Archive Directory Program Manual

DESCRIPTION

VGArchDir is a utility program that invokes WinZIP32.exe to archive the current or specified directory to a ZIP file stored in the "Archives" subdirectory of that directory. 

This program has been developed with WinZip32 version 5.0 through 12, but will probably work with later versions.  WinZip32.exe is not included and should be obtained from WinZip.

Let us use the following definitions:

Starting Directory = the directory that is considered current under the operating system situations described below, or that is explicitly specified as the starting directory by the command invoking VGArchDir.  The Starting Directory Name is a folder name, such as "VGMirror", that is the final part of the Fully Qualified Directory Specification (FQDS) of the Starting Directory, such as "Y:\VB\VGMirror\".

Archives Directory = a child subdirectory named "Archives" and located directly under the Starting Directory.  It is created if it does not already exist.

Target File = the ZIP file to be created by VGArchDir in the Archives Directory.  It may be given by a Fully Qualified File Specification (FQFS).

Using this terminology, here are some examples of what VGArchDir does and the filenames it creates:

If the FQDS of the Starting Directory is "Y:\VB\VGMirror\" and the current date is July 20, 1999, VGArchDir creates a new ZIP file (Target File) with the following FQFS:
     "Y:\VB\VGMirror\Archives\VGMirror19990720.ZIP"
This target file (ZIP file) contains the files in "Y:\VB\VGMirror\".  (Optionally, VGArchDir also includes in the target file the files in the subdirectories of the Starting Directory, see below).

If the Starting Directory Name ends in a digit (e.g., "Y:\VC\VG32\"), the filename of the new target file created will contain "_" after the Starting Directory Name; e.g.
     "Y:\VC\VG32_19990720.ZIP"

If the Starting Directory is the root directory of the drive (e.g., "Y:\"), the target file name starts with the characters "RootDir"; e.g.
     "Y:\Archives\RootDir19990720.ZIP"

If the intended Target File name already exists (i.e., has been saved in the Archives Directory with a Target File name including the current date), VGArchDir retains the earliest ZIP file created for the current date with name unmodified, but names the newly created Target File with the letter 'a' inserted before the ".ZIP" extension.  For example, if the intended Target File is "Y:\VC\VG32_19990720.ZIP", but a file of this name already exists, VGArchDir will leave the existing file "Y:\VC\VG32_19990720.ZIP" unchanged, and will create as the new Target File a file named "Y:\VC\VG32_19990720a.ZIP".  (A pre-existing copy, if any, of "Y:\VC\VG32_19990720a.ZIP" is overwritten in this operation.) 

Up to 5 consecutive ZIP files are retained in the Archives Directory, each with a different name based on the date created, with no more than 2 files created for any single day (using the added "a" for the more recent file on this date).  The maximum number of 5 files is programmatically fixed and cannot be modified by the user.

The existing ZIP files located in the Archives Directory—and that match the naming pattern expected for the name of the Starting Directory—are not included in the ZIP file created.  In other words, if Y:\VB\VGMirror\ is the Starting Directory, then files matching Y:\VB\VGMirror\Archives\VGMirror*.ZIP are not included in the Target File created (such as Y:\VB\VGMirror\Archives\VGMirror19990720.ZIP).  However, other files in the Archives Directory that do not match the expected pattern will be included in the Target File.

VGArchDir runs under and has been tested with Windows NT 4.0, XP, Windows 2000, and the 64-bit version of Windows 7. VGArchDir is copyrighted by Michael McGoodwin, 1997-2011.  The user is welcome to use VGArchDir without cost but may not charge to redistribute it.

HOW TO RUN VGARCHDIR

See INSTALLATION regarding placing VGArchDir in a PATH directory.   If VGArchDir.EXE is not located in the executable PATH environmental variable string, you must type the full path to VGArchDir, e.g., C:\Misc\VGArchDir.EXE,  regardless of the method chosen below to invoke it.

To run VGArchDir in NT 4.0 File Manager

File Manager is considered obsolete for most current Windows users, but was a highly useful program and can run VGArchDir if you have it or have adapted it to run in your newer generation Windows installation.

Highlight the desired Starting Directory in File Manager (this makes it "Current"). Then do File | Run, and type
      VGArchDir <Enter>. 

To recursively include underlying subdirectories of the Starting Directory and their files, add the command line option /r, e.g.
      VGArchDir /r <Enter>

You may optionally specify a fully qualified Starting Directory specification (to be processed instead of the current directory) as the first parameter, e.g., 
      VGArchDir "C:\My Dir" <Enter>

Additional parameters such as /r should follow the Starting Directory specified if any, e.g.
      VGArchDir "C:\My Dir" /r <Enter>

To have VGArchDir copy to the clipboard the FQFS of the Target File, add the parameter /f at the end, e.g.
      VGArchDir /f <Enter>
      VGArchDir "C:\My Dir" /r /f <Enter>
The purpose of the /f optional switch is to make it possible to use the FQFS of the Target File in a batch script file that invokes VGArchDir.  The same FQFS of the Target File is also copied to a file located in the VGArchDir program directory called VGArchDirFileCreated.txt (replacing previous contents), and this file may also be useful in a programming a batch script file that invokes VGArchDir.

To run VGArchDir in Windows Explorer

If you have not already done this, create a shortcut file (.LNK file) in Windows Explorer or the Desktop pointing to the VGArchDir.EXE file.   Name it "VGArchDir".   Copy this shortcut file (i.e., "VGArchDir.LNK") to the SendTo directory for the current user (you).  For example, 

      C:\WINNT\Profiles\Administrator\SENDTO\VGArchDir.LNK

In Windows 7, you access this SendTo destination directory with %APPDATA%\Microsoft\Windows\SendTo

When you wish to archive a directory, Right-Click the desired directory in Windows Explorer and invoke "Send To" and select VGArchDir

Note: I do not believe it is possible to pass additional parameters such as /r or /f with this method—you will need a hard coded shortcut or run VGArchDir from a command prompt or batch file to do this.

To run VGArchDir at a command prompt or in a batch script file

Assuming the directory of VGArchDir.exe has been added in the PATH environmental variable:

To archive the current directory only:
      VGArchDir <Enter>.

To recursively include underlying subdirectories of the current directory and their files, add the command line option /r, e.g.
      VGArchDir /r <Enter>

You may optionally specify a fully qualified Starting Directory specification (to be processed instead of the current directory) as the first parameter, e.g., 
      VGArchDir "C:\My Dir" <Enter>

Additional parameters such as /r should follow the Starting Directory specification, if any, e.g.
      VGArchDir "C:\My Dir" /r <Enter>

To have VGArchDir copy to the clipboard the FQFS of the Target File, add the parameter /f at the end, e.g.
      VGArchDir /f <Enter>
      VGArchDir "C:\My Dir" /r /f <Enter>
The purpose of the /f optional switch is to make it possible to use the FQFS of the Target File in a batch script file that invokes VGArchDir.  The same FQFS of the Target File is also copied to a file located in the VGArchDir program directory called VGArchDirFileCreated.txt (replacing previous contents), and this file may also be useful in programming a batch script file that invokes VGArchDir.

INSTALLATION

  1. Close all running programs.

  2. Place vgadinst.exe in an empty temporary directory, run it, specify an empty temporary destination (may be the same one) to serve as the destination directory to hold the installation files and press Unzip to decompress the files needed to install VGArchDir

  3. Find and run Setup.exe (one of the files that have been decompressed).   Select a final directory of your choice to install VGArchDir to. 

  4. The destination directory of VGArchDir.EXE must be pointed to by the Path system variable. The steps vary according to the OS, but in Windows 7 one would add to the Path with Control Panel | System | Advanced System Settings | Environment Variables | System Variables | Path = etc. The entries in Path should be separated by semicolons.

  5. After installation, you may delete all files in the temporary directory where the decompressed files including setup.exe were placed.

  6. See above regarding adding a SendTo menu item in Windows Explorer.

FILES REQUIRED

(List does not include MS VB or setup files)

REVISIONS HISTORY

(These notes are of probably of interest only to the developer) 

9/1/98 v. 1.4
Now will rename Test19980623a.ZIP to Test19980623.ZIP if there is no Test19980623.ZIP, .then will save to Test19980623a.ZIP.
Added splash form with copyright info

9/6/98 v. 1.5:
Substituted RegObj.DLL registry routines

9/15/98 v. 1.6:
Added quotes to Shell params so directories and file names can contain spaces
Added option to explicitly specify directory instead of current directory
Added method for using in Windows Explorer
Added -r option to recurse directories without "Extra Information"
When -r selected, does not include .\Archives\*.* files in the ZIP file created
Tweaked form and additional error handling
Does not show in Task Bar as blank form; only WinZip in task bar

10/15/98 v. 1.7:
Removed RegObj.DLL and substituted VGRegObj (requires VgRegObj.DLL)

11/15/98 v. 1.8:
Fixed problem with moving files on recursive archiving
Will not abort now if directory empty but there is at least one subdirectory and /r option
Fixed error in creating sModifiedSourceDirName$

12/29/98 v. 1.9:
Fixed SendTo in Windows Explorer passes Short (8.3) Dir Name, convert to Long Format

1/9/1999 v. 2.0:
Fixed incorrect handling of files not ending in ZIP

7/20/1999 v. 2.1:
Added /f parameter option to copy name of ZIP file created to clipboard as text.
The same file spec is also copied to a file located in the VGArchDir program directory called VGArchDirFileCreated.txt (replacing previous contents)

7/21/1999 v. 2.2:
Substituted "Name" for FileMove when moving files.
Now moves .\Archives\*.ZIP files on recursive call to the same drive, a temp dir 
(These 2 changes should be faster and hopefully lowers risk of filling drive)

6/25/2002 v. 2.3:
Fixed rare problem when directory name has been truncated since VGArchDir has been run and there are leftover archived files named after the longer directory name. Also now deletes older ZIP files only if their names precisely match the expected patterns and incorporate dates ranging from 19950101 to today's date.

11/25/2004 v. 2.4
Fixed registry-related bug for new installations.

4/20/2005 v. 2.4
Fixed problem with setup program.

2/21/2011 – 3/9/2011 v. 2.4
Confirmed program is operational in Windows 7 64-bit, and revised manual for this OS, added further operation clarifications.