Shell Regedit not working!

School Boy Error

New member
Joined
Mar 6, 2012
Messages
3
Programming Experience
Beginner
Hi, I am using Visual Studio 2010 and have begun a console application. I want to import a file into the registry and I'm stuck at the moment in that Shell will not open the registry editor.

I have tried
VB.NET:
Shell("C:\Windows\regedit.exe")
I have tried
VB.NET:
Shell("regedit.exe")

None of these work whereas

VB.NET:
Shell("cmd.exe")
and
VB.NET:
Shell("C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.exe")

work perfectly!

Any ideas?
 
First up, don't use Shell in VB.NET. To start a new process, call Process.Start. I just tried Process.Start("regedit") and it worked exactly as expected.

That said, why do you need to open RegEdit to import a file? You can just execute the file directly, again using Process.Start, just as you can double-click on a REG file to import it.
 
First up, don't use Shell in VB.NET. To start a new process, call Process.Start. I just tried Process.Start("regedit") and it worked exactly as expected.

That said, why do you need to open RegEdit to import a file? You can just execute the file directly, again using Process.Start, just as you can double-click on a REG file to import it.

Thanks I'll give that a try.
 
Back
Top