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.
LVL 1
unrealone1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rhandelsCommented:
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
0
Thomas GrassiSystems AdministratorCommented:
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
0
Gabriel CliftonNet AdminCommented:
REG ADD "HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "PreferLocalXML" /T dword /D 1 /F

This would be the simple way.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

PaulNSWCommented:
You could always use Group Policy if the machines are on a domain
0
becraigCommented:
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

0
unrealone1Author Commented:
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
0
rhandelsCommented:
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
0
becraigCommented:
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.
0
Thomas GrassiSystems AdministratorCommented:
He can also just add it to the login script then the users do not need to click on it.
0
becraigCommented:
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.
0
unrealone1Author Commented:
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.
0
rhandelsCommented:
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.
0
unrealone1Author Commented:
Thanks for all your help. Gabriel's solution works best for us.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.