drosenkranz
Programmer
I have a main EXE (Case Management Tracking Reg.EXE) that is running fine. I have a small program that is just a piece of code (shown below) that checks to see if the user's local copy of the EXE is not the same as the latest version residing on the server. If it is not, a copy is written to their local hard drive from the server and then launched with the shell command.
The problem is that when the Shell command launches the EXE, it still launches the OLD copy! I have checked the file and it is being overwriitten with the new version on the FileCopy command line. How can I get the Shell command to launch the new copy- I don't get how it still launches the old version?
Dim str1 'used below for MsgBox
Dim vServerCopy As Variant 'Server's EXE Version
Dim vLocalCopy As Variant 'Local PC's EXE Version
'
'On Error GoTo err_handler_1
'
vServerCopy = FileDateTime("M:\Case Management Tracking Reg.EXE"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
vLocalCopy = FileDateTime("C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'
If vServerCopy <> vLocalCopy Then 'user has an outdated copy
'
str1 = "Please Be Patient While Your Software Is Being Updated..."
MsgBox str1, vbOKOnly, "Update Required:"
'
'remove old version
Kill "C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
'
FileCopy "M:\Case Management Tracking Reg.EXE", "C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
Endif
' run the main program (exe)
Shell ("C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
'
End
'
Exit Sub
err_handler_1:
MsgBox "File Unavailable Or The Server May Be Down.", vbOKOnly, "Error:"
End
' The early bird may get the occasional worm...
but the 2nd mouse always gets the cheese.
The problem is that when the Shell command launches the EXE, it still launches the OLD copy! I have checked the file and it is being overwriitten with the new version on the FileCopy command line. How can I get the Shell command to launch the new copy- I don't get how it still launches the old version?
Dim str1 'used below for MsgBox
Dim vServerCopy As Variant 'Server's EXE Version
Dim vLocalCopy As Variant 'Local PC's EXE Version
'
'On Error GoTo err_handler_1
'
vServerCopy = FileDateTime("M:\Case Management Tracking Reg.EXE"
vLocalCopy = FileDateTime("C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
'
If vServerCopy <> vLocalCopy Then 'user has an outdated copy
'
str1 = "Please Be Patient While Your Software Is Being Updated..."
MsgBox str1, vbOKOnly, "Update Required:"
'
'remove old version
Kill "C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
'
FileCopy "M:\Case Management Tracking Reg.EXE", "C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
Endif
' run the main program (exe)
Shell ("C:\Program Files\Case Management Tracking\Case Management Tracking Reg.EXE"
'
End
'
Exit Sub
err_handler_1:
MsgBox "File Unavailable Or The Server May Be Down.", vbOKOnly, "Error:"
End
' The early bird may get the occasional worm...
but the 2nd mouse always gets the cheese.