Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: DLLs update DLLs file locks locked files wininit.ini automatic update
In Windows NT it is fairly easy. See IntControl(30, ...)
In Windows 95 you make a file called WININIT.INI. It tells the system what to do when
you reboot the machine. You copy the file
to the drive you need it on with a different name and make a WININIT.INI file in the
Windows directory "DirWindows(0)" that looks
like:
P.S. You must use the SHORT version of the filename (see FileNameShort).
[rename] ; newname=oldname c:\xxx\myfile.dll=c:\xxx\myfile.tmp c:\xxx\somedll.dll=c:\temp\tempname.dll ; to delete a file... NUL=C:\yyy\trash.exeIn Win16 you make a BAT file and execute it with the RunExit function.
; User launches compiled WBT file Exe file checks server to see if update is required. if update not required run normal code else run update program on server EXIT endif ;******************************************* ;And now for the update program TimeDelay(5) ; wait for original program to exit FileCopy("new.exe","old.exe",0) Run the program again exit
The self-updating program could start like this:
If RunOnce = RegOpenKey ( @RegMachine , `SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce` ) RegSetValue ( RunOnce , `[Command]` , `command.com /c copy \\SERVER\SHARE\WBNEWVER\mywbpgm.exe C:\myplace` ) RegCloseKey ( RunOnce ) IntControl ( 67 , 0 , 0 , 0 , 0 ) End IfWhen a new version is detected, the program itself places the command line in the registry and reboots. Anything placed in the runonce section is executed once and then automatically removed.
What I cannot tell is if the copy will take place before the program is executed. It depends on its location in the chain of events. This you will have to check...
Article ID: W13192
Filename: Update WinBatch DLLs and EXEs.txt
File Created: 1999:04:15:16:52:22
Last Updated: 1999:04:15:16:52:22