Avatar of unrealone1
unrealone1
Flag 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.
Windows 7Microsoft OfficeOutlook

Avatar of undefined
Last Comment
unrealone1

8/22/2022 - Mon
rhandels

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
Member_2_6492660_1

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
Gabriel Clifton

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PaulNSW

You could always use Group Policy if the machines are on a domain
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
becraig

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

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
rhandels

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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
becraig

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.
Member_2_6492660_1

He can also just add it to the login script then the users do not need to click on it.
becraig

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
unrealone1

ASKER
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.
rhandels

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.
unrealone1

ASKER
Thanks for all your help. Gabriel's solution works best for us.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.