delete .exe then copy .exe batch

Hewlett-packard / Sd2100
March 29, 2009 at 23:07:34
Specs: Windows XP, 1024
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.exe

testprogram.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.exe

Thank you guys!!!!!


See More: delete .exe then copy .exe batch

Report •


#1
March 31, 2009 at 12:35:31
any ideas guys?

Report •

#2
March 31, 2009 at 21:30:18
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 If

UpdateApplication function basically check for update.exe filedatetime and local.exe filedatetime. downloading when necessary.


Report •

#3
April 1, 2009 at 13:01:12
any care to convert it or at least show me a batch code that will work for that?

Thank you


Report •

Related Solutions

#4
April 2, 2009 at 01:44:09
set prog=testprogram.exe
set update=update.exe

for %%a in (%prog%) do set d1=%%~ta
for %%a in (%update%) do set d2=%%~ta

if not "d1"=="d2" copy %update% %prog%


Report •

#5
April 2, 2009 at 09:36:47
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!!!


Report •

#6
April 2, 2009 at 09:38:20
DELETED POST

Report •

#7
April 2, 2009 at 09:39:48
DELETED POST

Report •

#8
April 2, 2009 at 10:30:52
sorry for all the posts, network frooze connection stalled and re posted.

Report •

#9
April 2, 2009 at 21:36:01
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"


Report •


Ask Question