|
-
Feb 13th, 2008, 12:28 PM
#4
Thread Starter
Addicted Member
Re: Reg import issue
I've now updated my code and managed to get it all working, only problem is that a message box will keep appearing several times (in this example it would appear 3 times).
It seems like my program continues to run through each file and give an outcome for each.
The code itself does the job just fine, I have also tested it by removing files from the folder and it will give the msgbox I expect, but its just the fact that I have message boxes appearing for all 3 files, which is quite annoying.
I guess the ideal scenario would be to have the program stop if it detects a file missing.
Trying to find the easyiest solution, hence it would be nice to keep this code.
Anyways heres the code.
Code:
Private Sub regimprt_b(regfilename As String) 'Net Meeting Registry Import
If objFSO.FileExists("C:\Maintainer\Video Stream\Reg\" & regfilename) Then
wshell.Exec "regedit /s ""C:\Maintainer\Video Stream\Reg\" & regfilename
'gets the .reg file name from cmdVideoStream.click
MsgBox "passed", vbInformation + vbOKOnly, Me.Caption
Else
MsgBox "File(s) missing within C:\Maintainer\Video Stream\Reg\", vbCritical + vbOKOnly, Me.Caption
End If
End Sub
Private Sub cmdVideoStream_Click()
'calls regimprt_b sub and imports the files into the registry
regimprt_b "Auto Accept Calls Disabled.reg"
regimprt_b "Auto Mix.reg"
regimprt_b "Calibrated Volume.reg"
end sub
Oh and I have tried & regfilename in the msgbox which shows which file is missing but i'ts not really a requirement.
Last edited by jbennett; Feb 13th, 2008 at 12:45 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|