R
Red Rider
I'm trying to get the AutoUpdate Front End program to run. This
program will automatically update each users FE if the version #'s
don't match. Here's the last of the code where the copying takes
place. It creates the UpdateDbFE.cmd OK but does not execute the
Shell TestFile command. If I just double-click this file
(UpdateDbFE.cmd) outside of Access it runs OK, executing all the
commands. Here's the code:
Public Sub UpdateFrontEnd()
Dim strCmdBatch As String
Dim notNotebook As Object
Dim FSys As Object
Dim TestFile As String
Dim strKillFile As String
Dim strReplFile As String
Dim strRestart As String
' added 12/2/08 to also copy PDF Help file on update
Dim strKillHelpFile As String
Dim strReplHelpFile As String
' sets the file name and location for the file to delete
strKillHelpFile = g_strHelpFilePath
' sets the file name and location for the file to copy
strReplHelpFile = g_strCopyLocation & "\Grid Contracts Help File.PDF"
' sets the file name and location for the file to delete
strKillFile = g_strFilePath
' sets the file name and location for the file to copy
strReplFile = g_strCopyLocation & "\" & CurrentProject.Name
' sets the file name of the batch file to create
TestFile = CurrentProject.Path & "\UpdateDbFE.cmd"
' sets the restart file name
strRestart = """" & strKillFile & """"
' creates the batch file
Open TestFile For Output As #1
Print #1, "Echo Off"
Print #1, "ECHO Deleting old file"
Print #1, ""
Print #1, "ping 1.1.1.1 -n 1 -w 9000"
Print #1, ""
Print #1, "Del """ & strKillFile & """"
Print #1, ""
Print #1, "ECHO Copying new file"
Print #1, "Copy /Y """ & strReplFile & """ """ & strKillFile & """"
Print #1, "ECHO Copying new Help file"
Print #1, "Copy /Y """ & strReplHelpFile & """ """ & strKillHelpFile &
""""
Print #1, ""
Print #1, "CLICK ANY KEY TO RESTART THE ACCESS PROGRAM"
Print #1, "START /I " & """MSAccess.exe"" " & strRestart
Close #1
' Exit Sub
' runs the batch file
MsgBox "Click OK to Start Batch" ' I see this message
Shell TestFile
MsgBox "Batch File Started" ' I don't see this message
'closes the current version and runs the batch file
DoCmd.Quit
End Sub
Any help will be appreciated.
program will automatically update each users FE if the version #'s
don't match. Here's the last of the code where the copying takes
place. It creates the UpdateDbFE.cmd OK but does not execute the
Shell TestFile command. If I just double-click this file
(UpdateDbFE.cmd) outside of Access it runs OK, executing all the
commands. Here's the code:
Public Sub UpdateFrontEnd()
Dim strCmdBatch As String
Dim notNotebook As Object
Dim FSys As Object
Dim TestFile As String
Dim strKillFile As String
Dim strReplFile As String
Dim strRestart As String
' added 12/2/08 to also copy PDF Help file on update
Dim strKillHelpFile As String
Dim strReplHelpFile As String
' sets the file name and location for the file to delete
strKillHelpFile = g_strHelpFilePath
' sets the file name and location for the file to copy
strReplHelpFile = g_strCopyLocation & "\Grid Contracts Help File.PDF"
' sets the file name and location for the file to delete
strKillFile = g_strFilePath
' sets the file name and location for the file to copy
strReplFile = g_strCopyLocation & "\" & CurrentProject.Name
' sets the file name of the batch file to create
TestFile = CurrentProject.Path & "\UpdateDbFE.cmd"
' sets the restart file name
strRestart = """" & strKillFile & """"
' creates the batch file
Open TestFile For Output As #1
Print #1, "Echo Off"
Print #1, "ECHO Deleting old file"
Print #1, ""
Print #1, "ping 1.1.1.1 -n 1 -w 9000"
Print #1, ""
Print #1, "Del """ & strKillFile & """"
Print #1, ""
Print #1, "ECHO Copying new file"
Print #1, "Copy /Y """ & strReplFile & """ """ & strKillFile & """"
Print #1, "ECHO Copying new Help file"
Print #1, "Copy /Y """ & strReplHelpFile & """ """ & strKillHelpFile &
""""
Print #1, ""
Print #1, "CLICK ANY KEY TO RESTART THE ACCESS PROGRAM"
Print #1, "START /I " & """MSAccess.exe"" " & strRestart
Close #1
' Exit Sub
' runs the batch file
MsgBox "Click OK to Start Batch" ' I see this message
Shell TestFile
MsgBox "Batch File Started" ' I don't see this message
'closes the current version and runs the batch file
DoCmd.Quit
End Sub
Any help will be appreciated.