markh47
June 18th, 2009, 05:41 AM
Hi all,
I wondered if someone would be able to help me.
I have created a very basic program in VB that will run a batch file that writes a reg file to the registry (see code below) . In XP it works fine with no problems. However, with vista it comes up with a security error and does not run the batch file.
The error it says is:
"The application attempted to perform an operation that was not allowed by the security policy. The operation required the Security Exception. To grant this application the required permission please contact your systems administrator, or use the Microsoft.NET security policy administration tool"
activate.bat
regedit /s "reg/activateProxy.reg"
deactivate.bat
regedit /s "reg/deactivateProxy.reg"
Code from the VB application
Private Sub cmdActivate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdActivate.Click
Process.Start("reg\activate.bat")
MsgBox("Your College settings are now activated!", MsgBoxStyle.Information, "ACTIVATE")
End Sub
Private Sub cmdDeactivate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDeactivate.Click
Process.Start("reg\deactivate.bat")
MsgBox("Your Home settings are now de-activated!", MsgBoxStyle.Information, "DE-ACTIVATE")
End Sub
Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
End
End Sub
will I have to have different reg files for Vista than XP or would they be universal?
The aim on both is to activate the proxy settings and exceptions on IE and have an option to deactivate them aswell.
The registary files just contain the settings for IE both on and off.
Any suggestions would be appricated as I am not the best at programming but least at all when it comes to vista.
Thanks
Mark
I wondered if someone would be able to help me.
I have created a very basic program in VB that will run a batch file that writes a reg file to the registry (see code below) . In XP it works fine with no problems. However, with vista it comes up with a security error and does not run the batch file.
The error it says is:
"The application attempted to perform an operation that was not allowed by the security policy. The operation required the Security Exception. To grant this application the required permission please contact your systems administrator, or use the Microsoft.NET security policy administration tool"
activate.bat
regedit /s "reg/activateProxy.reg"
deactivate.bat
regedit /s "reg/deactivateProxy.reg"
Code from the VB application
Private Sub cmdActivate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdActivate.Click
Process.Start("reg\activate.bat")
MsgBox("Your College settings are now activated!", MsgBoxStyle.Information, "ACTIVATE")
End Sub
Private Sub cmdDeactivate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDeactivate.Click
Process.Start("reg\deactivate.bat")
MsgBox("Your Home settings are now de-activated!", MsgBoxStyle.Information, "DE-ACTIVATE")
End Sub
Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
End
End Sub
will I have to have different reg files for Vista than XP or would they be universal?
The aim on both is to activate the proxy settings and exceptions on IE and have an option to deactivate them aswell.
The registary files just contain the settings for IE both on and off.
Any suggestions would be appricated as I am not the best at programming but least at all when it comes to vista.
Thanks
Mark