Link to home
Start Free TrialLog in
Avatar of unrealone1
unrealone1Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Registry changes Via batch files

Hi,

I have to make the below change on 100 machines in a phased method.

Is there a way I can change the following registry entires via a batch file?

2007: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\AutoDiscover
"PreferLocalXML"=dword:1
"ExcludeHttpRedirect"=dword:0
"ExcludeHttpsAutodiscoverDomain"=dword:1
"ExcludeHttpsRootDomain"=dword:1
"ExcludeScpLookup"=dword:1
"ExcludeSrvLookup"=dword:1
"ExcludeSrvRecord"=dword:1

Thanks.
Avatar of rhandels
rhandels
Flag of Netherlands image

Hey,

You can create a .vbs file (not quite sure if this will work with a bat file) and add the following lines. And so on and so forth, you get the idea i guess.. :)

REG.exe ADD HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover /v PreferLocalXML /d 1 /f
REG.exe ADD HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover /v ExcludeHttpRedirect /d 1 /f
You can try this

 @ECHO OFF
 CLS
REGEDIT.EXE /S  yourfilename.reg
EXIT


Create yourfilename.reg with
2007: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\AutoDiscover
 "PreferLocalXML"=dword:1
 "ExcludeHttpRedirect"=dword:0
 "ExcludeHttpsAutodiscoverDomain"=dword:1
 "ExcludeHttpsRootDomain"=dword:1
 "ExcludeScpLookup"=dword:1
 "ExcludeSrvLookup"=dword:1
 "ExcludeSrvRecord"=dword:1

as its contents
ASKER CERTIFIED SOLUTION
Avatar of Gabriel Clifton
Gabriel Clifton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PaulNSW
You could always use Group Policy if the machines are on a domain
cumbersome but short answer

A list of all the computers in a file computers.txt

then run the below commands:

for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "PreferLocalXML" /T dword /D 1 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeHttpRedirect" /T dword /D 0 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeHttpsAutodiscoverDomain"  /T dword /D 1 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeHttpsRootDomain"  /T dword /D 1 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeScpLookup"  /T dword /D 1 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeSrvLookup"  /T dword /D 1 /F
for /f %a in (computers.txt) do REG ADD "\\%a\HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "ExcludeSrvRecord"  /T dword /D 1 /F

Open in new window

Avatar of unrealone1

ASKER

Hi,

Thanks for the responses. I would like to have a batch file I can just double click on each machine to run. Therefore would creating a file with the below for each value I need to change be the best way?

Would this overwrite any existing registry entries?

REG ADD "HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "PreferLocalXML" /T dword /D 1 /F
Hey,

Yes you would need a batch file with all those rules and yes, it will overwrite all existing entries because of the /f (which means force) so it suppresses a message when the key already exists.

You can off course remove the /f but that would mean clicking a lot
Why would you want to do this locally via clicking on a batch file ?


First problem I see with that approach is the sheer consumption of time.
Second issue, you will have "users" clicking on bat files (which they can read in notepad etc if they feel inquisitive) to make registry changes ?


I think you are better off managing via gpo or scripting out from a central location.
He can also just add it to the login script then the users do not need to click on it.
Anything that removes the option of a user clicking on a batch file gets my vote, I just think it is a bad path to go down.
Hi,

We are doing a migration to a hosted mail provider who requests that we make these changes to every users machine.

As we are doing this in a phased method by department we will need to run this as we are ready to re-configure the users email each time, running this as a batch file each time will greatly speed up the process.

Thanks for the responses. Is there anything additional i need to put into the script?

The users dont have admin rights so I assume i will have to run with elevated permissions.
Hey,

First off i do agree with some of the comments that there are better ways to do this but i think it is still up to the original poster on how he (or she) wants do have something done. If you want to do it manually (though heavy time consuming) than please feel free to do so.

Second of, problem is these are user settings so no, don't run them with elevated privileges, this would mean using another account and then these settings will be placed in the HKCU of that other account. So just fire it of with the user being affected logged in.

Also do keep in mind that, if you don't have roaming profiles, you will need to do this for all and every local profile a user has on any machine.
Thanks for all your help. Gabriel's solution works best for us.