|
-
Nov 6th, 2006, 05:18 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] shell "file.msc" not working
i have a command button, which loads gpedit.msc but it wont work. Is my coding wrong.
VB Code:
Shell "GPEDIT.MSC", vbNormalFocus
-
Nov 6th, 2006, 05:22 PM
#2
Re: shell "file.msc" not working
Try shelling the mmc and pass the snapin template as an argument.
VB Code:
Shell "C:\WINDOWS\system32\mmc.exe C:\GPEDIT.MSC", vbNormalFocus
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 6th, 2006, 05:31 PM
#3
Thread Starter
Hyperactive Member
Re: shell "file.msc" not working
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"
-
Nov 6th, 2006, 05:32 PM
#4
Re: shell "file.msc" not working
Passing an argument to an exe is done after the exe's filepath/name with a space separating the two.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 6th, 2006, 05:35 PM
#5
Re: shell "file.msc" not working
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 6th, 2006, 05:52 PM
#6
Thread Starter
Hyperactive Member
Re: shell "file.msc" not working
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
|