Cool Solutions

RunIfNewer



By:

April 6, 2005 4:30 pm

Reads: 3393

Comments:0

License:
Free

Download runifnewer

By Bryan Keadle

Sometimes, I want to run a program only if the program (or it’s data file) has changed since the last time it was run. RunIfNewer allows me to run a program based on whether it, or some specified file, has changed.

For example, we download the latest virus definitions (an .EXE posted) to the network, and our workstation administration batch file as part of our login script will execute this definitions update whenever it is newer than the last time it was run on the workstation:

RUNIFNEWER WS QUIET / F:\PUBLIC\NavDef.exe /s /q

Another example, we can easily distribute a group of files/directories to workstations upon login whenever we update the source ZIP file:

RUNIFNEWER WS QUIET FILE=F:\PUBLIC\WSFILES.ZIP / pkzip32-extract=update -overwrite=all F:\PUBLIC\WSFILES.ZIP C:\

SYNTAX: RUNIFNEWER (USER/WS/MIN/HIDDEN/NOWAIT/QUIET/FILE=) / (Program name) (Parameters)

Checks if (Program Name) has newer date/time stamp, unless FILE= is specified, in which case, it checks the date/time stamp of the specified file, and runs (Program name) if IT is newer. This accomodates a data file changing date/time instead of the executable.

**NOTE:
“/” is required to delimit between RUNIFNEWER options and the Program and parameters entry

If (Program Name) has a newer file date/time than the last time it was run, run it, otherwise skip it.
This program is intended for administration-type programs, like batch files, that need to be distributed/run only when changes are made/added.

Option Defaults are:

HKLM registry flag (WS)
WAIT for program to finish before continuing
Run in Normal Window
with BoxText info (not QUIET)

Hold down SHIFT key to view/manage the Registry flag entries.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)


Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS