We help IT Professionals succeed at work.

Edit group policies through batch file

outlaw45 asked
I am at a school that does not use active directory.  I need to go to individual computers and run a batch file to enable/disable a proxy filter.  Some computers have up to six (6) users log on per day.  How can I do this for all users without having to log on each user and make the change?  How do I make the group policy edit in XP part of the batch file and what about Vista Home Premium?
Watch Question

work around

try using remote desktop
>> "a proxy filter"

Do you mean a proxy server?

If so - the registry information is at:
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Internet Settings]
Value Name: ProxyServer, ProxyEnable, ProxyOverride
Data Type: REG_SZ (String Value)
Value Data: Server:Port
(from http://www.pctools.com/guides/registry/detail/292/)
If so - you can use reg add /f to change the proxy settings - and create a batch file - and run it as a logon script.

I.e. as you cannot use group policy - you could run the script from the local policies...
So - do some of them need access through the proxy - and others don't?
You can put the batch file in the All Users Startup folder so it will run each time a user logs in.  

Windows XP location:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

Vista Home Premium doesn't have the All Users profile, but you can place the batch file in each individual user's folder located:
C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

If you want to get fancy, you can have the batch file check if the registy key exists:



I'm sorry, yes I mean proxy server.  XP allows me to edit the registry through a batch file and change the current user.  I need to affect the whole machine without logging on to every user and setting the LAN settings and proxy settings by hand.  I have too many many machines and too many users.  Sitting at the computer, running a batch file and making the change for all users is what I need to do.
You can configure proxy settings for all users - using HKLM, rather than HKCU:


For some reason, HKLM does not work on Vista Home Premium
have you tried the registery ? thought about using remote desktop ? do you have the same settings for all users on the same machine ?

waiting for your reply


The solution was partly answered.  Not much response.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.