Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
ok i need help. what i want to do is
i have a exe file converted from batch.
i want to have a batch file del the testprogram.exe then copy the new version of testprogram.exe but only if the program date creation is less then the date of the newest testprogram.exetestprogram.exe date is lets say 01/01/09
newest testprogram.exe is 02/02/09
then have the batch delete older of testprogram.exe then copy to desktop the newest one. then start testprogram.exeThank you guys!!!!!

vb6 code, good luck in converting to batch.
'update to latest version, command parameter supplied is application name If App.EXEName = "update" Then If VBA.Command <> "" Then FileCopy ".\update.exe", VBA.Command ShellExecute Me.hwnd, VBA.Command End If Unload Me Exit Sub Else If FileExist(".\update.exe") Then Kill ".\update.exe" 'clean up End If ' check if newer version of this application is available Dim bUpdateApp As Boolean 'check if newer application is available bUpdateApp = UpdateApplication(App.EXEName & ".exe", ".\", "update.exe") 'check if an update has been downloaded If bUpdateApp And FileExist(".\update.exe") Then MsgBox "Program will be restarted for the effect to take change" Call ShellExecute(Me.hwnd, ".\update.exe", ".\" & App.EXEName & ".exe") Unload Me Exit Sub End IfUpdateApplication function basically check for update.exe filedatetime and local.exe filedatetime. downloading when necessary.

set prog=testprogram.exe
set update=update.exefor %%a in (%prog%) do set d1=%%~ta
for %%a in (%update%) do set d2=%%~taif not "d1"=="d2" copy %update% %prog%

Thanks that helped, one last Qustion,
where does the update.exe come from? do i add this to my program or is it a new one?
thanks for you help!!!

quote from brockey:
testprogram.exe date is lets say 01/01/09
newest testprogram.exe is 02/02/09
where does the update.exe come from? do i add this to my program or is it a new one?set prog=c:\pathtoprogramhere\testprogram.here
set update="d:\FULL path to update folder\newest_testprogram.exe"

![]() |
How to do verification on...
|
Disable windows key in ja...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |