GGHC
asked on
Batch Script to check date created of 2 exe. If source is newer, run command
I am looking to have a scheduled weekly task to run a script that will compare to .exes . If source is newer than run a setup command.
It will be used on Windows 10 Pro PCs.
It will be used on Windows 10 Pro PCs.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Change point split to:
Bill Prew's comment #a41892972 (200 points)
Bill Prew's comment #a41892355 (100 points)
Steve Knight's comment #a41892624 (200 points)
~bp
Bill Prew's comment #a41892972 (200 points)
Bill Prew's comment #a41892355 (100 points)
Steve Knight's comment #a41892624 (200 points)
~bp
Open in new window
If file2.exe is newer than file1.exe then it will show the filename and 1 File(s) otherwise 0 File(s)You could use that inside a script if wanted along the lines of:
Open in new window
The errorlevel from that of 1 would mean the files are the same, errorlevel 0 means do the copy
Open in new window
orOpen in new window
Bill's technique looks neater but that should work too if needed.
Steve