Novell Cool Solutions: Cool Tool
Run a program only if the program has updated.
|Posted:||6 Apr 2005|
Please read the note from our friends in legal before using this file.
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.
"/" 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.
Hold down SHIFT key to view/manage the Registry flag entries.
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com