i have a command button, which loads gpedit.msc but it wont work. Is my coding wrong.
VB Code:
Shell "GPEDIT.MSC", vbNormalFocus
Printable View
i have a command button, which loads gpedit.msc but it wont work. Is my coding wrong.
VB Code:
Shell "GPEDIT.MSC", vbNormalFocus
Try shelling the mmc and pass the snapin template as an argument.
VB Code:
Shell "C:\WINDOWS\system32\mmc.exe C:\GPEDIT.MSC", vbNormalFocus
sorry but how do i do that, i thought the code would be like this but its not.
VB Code:
Shell "GPEDIT.MSC", vbNormalFocus "gpedit.msc"
Passing an argument to an exe is done after the exe's filepath/name with a space separating the two.
This is a working example of shelling the management console with the defrag snap-in passed as an argument.
VB Code:
Option Explicit Private Sub Form_Load() Shell "C:\WINDOWS\system32\mmc.exe C:\Windows\System32\dfrg.msc", vbNormalFocus End Sub
thanks,