Launch Control Panel Extensions

'Add 2 Command Buttons and 1 File List Box to your form.
'Press the first button to lauch the control panel. press the second button
'to launch the selected control panel extension in the File List Box

'Insert this code to your form:

Public Sub RunControlPanelExtension(FileName As String)
Shell "rundll32.exe shell32.dll,Control_RunDLL " & FileName, vbNormalFocus
End Sub

Private Sub Command2_Click()
RunControlPanelExtension File1.FileName
End Sub

Private Sub Command1_Click()
Shell "rundll32.exe shell32.dll,Control_RunDLL", vbNormalFocus
End Sub

Private Sub Form_Load()
File1.Pattern = "*.CPL"
'In windows NT, replace 'C:\Windows\SYSTEM' with ''C:\WINNT\SYSTEM32'
File1.FileName = "C:\Windows\SYSTEM"
End Sub

Go Back