• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

Change registry key based on certain criteria

We have a need to allow a user to run a batch file that will compare a registry setting and change if it doesn't match a specified dword value.  For example:  We'd like to compare the proxyenable value to see if it's 0 or 1. Then based on that value it should change to the opposite value.  Thanks!
0
ctsalina
Asked:
ctsalina
  • 2
  • 2
1 Solution
 
arnoldCommented:
Change the permission on the key to allow the user to make this change. using regedit and right click permissions on the key or the application/vendor.

The problem is that your example can be controlled through a GPO i.e. certain users will have their configuration reflect that they can only access data throgh a proxy while other users can connect directly.

What is it that you want to do?
It also depends on where this value is. Hkey_current_user or hkey_local_machine.
0
 
ctsalinaAuthor Commented:
We just want the user to be able to double-click an icon on the desktop.  The batch file should check for the value of the proxyenable key.  If it's 0 it should change it to 1 and vice-versa.  This isn't a permissions issue.  Also we can't use GPO for this circumstance. These computers come and go off our network.  I've written a vbs script, but although I see the keys change as I want, it doesn't seem to be getting refreshed in the browser settings.
0
 
arnoldCommented:
the script on the desktop can still be there, the issue is that you have to grant the user permissions to modify the item.  It all depends on where the item is.

Into which registry are you making the change hkey_current_user?
Certain things do not take effect until the next login.

The GPO applies when the system and the user are local on the LAN.

How about start from the beginning.

From what you've written, you want when the user logs into your network to either get a proxy setting applied or get a proxy setting removed.
Where and how are these alterations made?  i.e. does the user by default has to have a proxy set when they are in a particular location but when the return those settings need to be cleared or vice versa.

The GPO applying proxy settings or removing them will only apply when the user is on the LAN within reach of a DC.
0
 
ctsalinaAuthor Commented:
I understood about the gpo, but I needed to circumvent that process and get the reg settings to work with a script I had. I think I found a solution and appreciate the efforts.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now