Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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

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

Ive found this code to disable ctrl+alt+del
http://cuinl.tripod.com/Tips/enablectrldel.htmbut i keep getting an error
"as any is not supported in declare Statements"
from the section "ByVal lpvParam As Any"
Any ideas whyIgnorance is Bliss but Knowledge is Power

Sorry Did some digging and found that "As any" was changed in vb.net
Still needing help with /s parameter.
Thanksp.s will make sure i research better before i post
Ignorance is Bliss but Knowledge is Power

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.
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 LongThe other functions should be pretty much the same as the classic VB6 code you posted.
Good luck,
-SN

Registy entries now work
After Along time researching i've found that vb.net is not powerfull enough to disable ctrl+alt+delThank You SN people like you are credits to computing.net
Ignorance is Bliss but Knowledge is Power

![]() |
VBS logon script help
|
OpenGL Header File proble...
|

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