[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Registry changes Via batch files

Posted on 2014-08-11
13
Medium Priority
?
690 Views
Last Modified: 2014-08-12
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.
0
Comment
Question by:unrealone1
  • 3
  • 3
  • 3
  • +3
13 Comments
 
LVL 23

Expert Comment

by:rhandels
ID: 40253091
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
 
LVL 23

Expert Comment

by:Thomas Grassi
ID: 40253106
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
 
LVL 13

Accepted Solution

by:
Gabriel Clifton earned 2000 total points
ID: 40253136
REG ADD "HKCU\Software\Microsoft\Office\12.0\Outlook\AutoDiscover" /V "PreferLocalXML" /T dword /D 1 /F

This would be the simple way.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Expert Comment

by:PaulNSW
ID: 40253157
You could always use Group Policy if the machines are on a domain
0
 
LVL 29

Expert Comment

by:becraig
ID: 40253159
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
 
LVL 1

Author Comment

by:unrealone1
ID: 40253245
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
 
LVL 23

Expert Comment

by:rhandels
ID: 40253262
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
 
LVL 29

Expert Comment

by:becraig
ID: 40253271
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
 
LVL 23

Expert Comment

by:Thomas Grassi
ID: 40253276
He can also just add it to the login script then the users do not need to click on it.
0
 
LVL 29

Expert Comment

by:becraig
ID: 40253294
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
 
LVL 1

Author Comment

by:unrealone1
ID: 40253553
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
 
LVL 23

Expert Comment

by:rhandels
ID: 40254976
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
 
LVL 1

Author Closing Comment

by:unrealone1
ID: 40255205
Thanks for all your help. Gabriel's solution works best for us.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question