Computing.Net > Forums > Programming > rinning .reg in vb.net

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

rinning .reg in vb.net

Reply to Message Icon

Name: Grusomhat
Date: January 2, 2006 at 15:28:46 Pacific
OS: XP
CPU/Ram: AMD 64+ , 1gb
Comment:

Hi
I have a Vb.net program that i am making that i need to run a .reg file when it starts and then run another one when it closes. Also it needs to be able to run them without the "Are you sure you want to ad the information in "directory" to the registry" Dialog. Or else would be possible to just disable ALT+CTRL+DEL From being used while the program is running.

Ignorance is Bliss but Knowledge is Power



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: January 2, 2006 at 20:35:53 Pacific
Reply:

Grusomhat-
Instead of running the .reg file directly, run regedit.exe with the .reg file and /s as parameters - the /s stands for silent and will make sure that dialog isn't popped.

Process.Start("regedit.exe", "myfile.reg /s")

Good luck,
-SN


0

Response Number 2
Name: Grusomhat
Date: January 2, 2006 at 21:51:34 Pacific
Reply:

Having trouble getting the silent parameter to work heres the code

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Process.Start("regedit.exe", "distskmgr.reg/s")

Also Is there any registy enrtry to disable Alt+ctrl+del thanks


Ignorance is Bliss but Knowledge is Power


0

Response Number 3
Name: Grusomhat
Date: January 2, 2006 at 22:11:49 Pacific
Reply:

Ive found this code to disable ctrl+alt+del
http://cuinl.tripod.com/Tips/enablectrldel.htm

but i keep getting an error
"as any is not supported in declare Statements"
from the section "ByVal lpvParam As Any"
Any ideas why

Ignorance is Bliss but Knowledge is Power


0

Response Number 4
Name: Grusomhat
Date: January 2, 2006 at 23:18:15 Pacific
Reply:

Sorry Did some digging and found that "As any" was changed in vb.net

Still needing help with /s parameter.
Thanks

p.s will make sure i research better before i post

Ignorance is Bliss but Knowledge is Power


0

Response Number 5
Name: SN
Date: January 3, 2006 at 07:42:58 Pacific
Reply:

Hi Grusomhat-
Maybe it needs to be a capital S, and you also need a space in between the / and the filename - try this:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Process.Start("regedit.exe", "/S distskmgr.reg")

As for disabling ctrl-alt-del, this seems like a monumentally bad idea to me, but I can at least convert the code on the page you posted to VB.Net.

So first I noticed that the code imports one of the windows Dlls...To do this in .NET, you use the DllImport attribute. Then I looked up the function name on pinvoke.net to see if somebody had already posted that function - which they had.

SystemParametersInfo function

But that's in C#...The VB.Net equivalent would be:
<DllImport("user32.dll", SetLastError := True)> _
Public Shared Function SystemParametersInfo(ByVal uAction As Long, ByVal uParam As Long, _
ByVal lpvParam As IntPtr, ByVal fuWinIni As Long) As Long

The other functions should be pretty much the same as the classic VB6 code you posted.

Good luck,
-SN


0

Related Posts

See More



Response Number 6
Name: Grusomhat
Date: January 3, 2006 at 13:11:25 Pacific
Reply:

Registy entries now work
After Along time researching i've found that vb.net is not powerfull enough to disable ctrl+alt+del

Thank You SN people like you are credits to computing.net

Ignorance is Bliss but Knowledge is Power


0

Sponsored Link
Ads by Google
Reply to Message Icon

VBS logon script help OpenGL Header File proble...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: rinning .reg in vb.net

Disable Close (x) Button in VB.NET www.computing.net/answers/programming/disable-close-x-button-in-vbnet/8319.html

can i use pointer in vb.net? www.computing.net/answers/programming/can-i-use-pointer-in-vbnet/14890.html

Trying to get App.Path in VB.Net www.computing.net/answers/programming/trying-to-get-apppath-in-vbnet/9372.html