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.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
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, test, test before you do anything drastic with it.