Re: self replacing EXE

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Steven Burn (pvt_at_noyb.com)
Date: 10/13/04


Date: Wed, 13 Oct 2004 23:18:34 +0100

Why not just have it check for a newer version as normal, and if a newer one
exists, shutdown the existing copy, and replace it using a .bat file or
something?

--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"David" <NOSPAMDavidGerst@anti-spam.tempco.com> wrote in message
news:uJfKBGXsEHA.2516@TK2MSFTNGP11.phx.gbl...
> I believe you are correct, and your reply makes sense.  I think what I
must
> have recalled reading was this article;
>
> How to replace currently locked files with Inuse.exe
> http://support.microsoft.com/default.aspx?scid=kb;en-us;228930
>
> which admittedly is something totally different.  I just wanted to be
sure.
>
> thanks,
>
> David
>
>
> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
> news:OW1GYxWsEHA.3872@TK2MSFTNGP15.phx.gbl...
> > David wrote:
> > > I could have sworn I found information on Microsoft's website one day
in
> > > regards to an EXE that could delete and replace itself.  I thought I
> > > bookmarked the page, but I can't find it now.  I don't know if I
smoked
> too
> > > much crack that day or what, but here is what I want to do.  I want to
> have
> > > the EXE start up, check the network to see if there is a newer
compiled
> > > version of the EXE and replace the old (running) EXE with the newer
one.
> I
> > > know I can simply use a script or bat file to copy the newer compiled
> > > program to the local disk... but I would like to have a program that
can
> > > update itself.  any info is appreciated.
> >
> > I've never seen this type of thing. We have a couple of apps that are
> > basically "stubs" that do nothing but check for newer components,
> > replace them if required and then launch another app with a command line
> > that tells the exe (Exe#2) it was launched from the "stub" program.
> >
> > All of this is invisible to the user.. all they know is that there are 2
> > exes in the folder and their shortcut points to one of them and if they
> > try to launch Exe#2, it complains that it wasn't started up correctly
> > (due to the missing "stub" generated command line that they never see.)
> >
> > That "stub" rarely changes so it's fairly straight forward and reliable.
> > The key is... no part of the actual program is running yet so we can
> > replace any part of it without worrying about anything (anything
> > windows related anyway)
> >
> > --
> > Ken Halter - MS-MVP-VB - http://www.vbsight.com
> > Please keep all discussions in the groups..
>
>


Relevant Pages

  • Running a bat file at windows CE boot
    ... I want to start a bat file at windows ce startup. ... This small exe application can launch IBMjvm.bat if I run it under telnet ... Chuck dot Lin at Symbol dot Com ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Running DOS and Batch Programs on XP
    ... David wrote: ... So perhaps going back to opening a command prompt and then running the bat file will have to suffice. ... Unfortunately, when I click the shortcut, the window opens with: ... R-click that, pick Properties, then the Program tab. ...
    (microsoft.public.windowsxp.general)
  • Re: Running DOS and Batch Programs on XP
    ... David wrote: ... Unfortunately, when I click the shortcut, the window opens with: ... instead of executing the Webster2 bat file. ... R-click that, pick Properties, then the Program tab. ...
    (microsoft.public.windowsxp.general)
  • Re: Running DOS and Batch Programs on XP
    ... David wrote: ... So perhaps going back to opening a command prompt and then running the bat file will have to suffice. ... Unfortunately, when I click the shortcut, the window opens with: ... R-click that, pick Properties, then the Program tab. ...
    (microsoft.public.windowsxp.general)
  • Re: Running DOS and Batch Programs on XP
    ... try put the wthpro.exe in the "Cmd line:" box ... David wrote: ... instead of executing the Webster2 bat file. ... R-click that, pick Properties, then the Program tab. ...
    (microsoft.public.windowsxp.general)