Hi,
I had an issue with some code yesterday but have managed to get it working. The only issue I have with the code is the fact that the regimprt "file" section doesn't detect whether the file exists.
I have got code at the top which detects if the folders exist and proceeds if so, but will fail if not. However I can't figure out how I can set this up with the reg import, Any ideaS?
Code:Private Sub regimprt_a(RegFileName As String) ' BPFTP Registry Import wshell.Exec "regedit /s ""C:\Maintainer\BPFTP\Reg\" & RegFileName Private Sub cmdBPFTPRepair_Click() If objFSO.FileExists("C:\Maintainer\BPFTP\Default Settings\Default.bps") And objFSO.FolderExists("C:\Program Files\BPFTP\") Then objFSO.CopyFile "C:\Maintainer\BPFTP\Default Settings\Default.bps", "C:\Program Files\BPFTP\Default.bps", OverwriteExisting MsgBox "Files Copied", vbInformation + vbOKOnly, Me.Caption regimprt_a "CacheExpiry.reg" regimprt_a "EmailAddress.reg" regimprt_a "LogFileName.reg" regimprt_a "MaximumNumberRetries.reg" regimprt_a "RetryDelay.reg" regimprt_a "TimeoutSecs.reg" regimprt_a "Viewer.reg" Else MsgBox "Copy Failed", vbCritical + vbOKOnly, Me.Caption End If End Sub




Reply With Quote