Computing.Net > Forums > Programming > delete .exe then copy .exe batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete .exe then copy .exe batch

Reply to Message Icon

Name: brockey01
Date: March 29, 2009 at 23:07:34 Pacific
OS: Windows XP
CPU/Ram: 1024
Product: Hewlett-packard / Sd2100
Subcategory: Batch
Comment:

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!!!!!



Sponsored Link
Ads by Google

Response Number 1
Name: brockey01
Date: March 31, 2009 at 12:35:31 Pacific
Reply:

any ideas guys?


0

Response Number 2
Name: reno
Date: March 31, 2009 at 21:30:18 Pacific
Reply:

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.


0

Response Number 3
Name: brockey01
Date: April 1, 2009 at 13:01:12 Pacific
Reply:

any care to convert it or at least show me a batch code that will work for that?

Thank you


0

Response Number 4
Name: reno
Date: April 2, 2009 at 01:44:09 Pacific
Reply:

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%


0

Response Number 5
Name: brockey01
Date: April 2, 2009 at 09:36:47 Pacific
Reply:

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!!!


0

Related Posts

See More



Response Number 6
Name: brockey01
Date: April 2, 2009 at 09:38:20 Pacific
Reply:

DELETED POST


0

Response Number 7
Name: brockey01
Date: April 2, 2009 at 09:39:48 Pacific
Reply:

DELETED POST


0

Response Number 8
Name: brockey01
Date: April 2, 2009 at 10:30:52 Pacific
Reply:

sorry for all the posts, network frooze connection stalled and re posted.


0

Response Number 9
Name: reno
Date: April 2, 2009 at 21:36:01 Pacific
Reply:

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"


0

Sponsored Link
Ads by Google
Reply to Message Icon

How to do verification on... Disable windows key in ja...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: delete .exe then copy .exe batch

delete a registry key with batch? www.computing.net/answers/programming/delete-a-registry-key-with-batch/8218.html

Registry/policies through batch... www.computing.net/answers/programming/registrypolicies-through-batch/13832.html

Making a batch file www.computing.net/answers/programming/making-a-batch-file/16102.html