Help - Search - Members - Calendar
Full Version: Batch file question
MSFN Forums > Coding, Scripting and Servers > Programming (C++, Delphi, VB, etc.)

   


Google Internet Forums Unattended CD/DVD Guide
tekniik
So the scenario is that we just moved to a new Intranet website on our domain. The intranet site is set as the default home page on our image. My objective is too change the home page via the registry in a log on script. So the very basic logic would be:

If http://old_intranet is the start page change to http://new_intranet
If http://old_intranet is not the start page, do nothing

The reason for not just changing everyone all at once is that I work at a law firm and I know we will get a lot of help desk calls from partners if we change their yahoo finance (or whatever) home page. I know how to change the site for everyone and know I can run a reg query command to see what it is currently set too, just having a problem putting it all together. Any assistance would be appreciated.

Domain - Windows 2k3
Clients - XP SP2

Thanks
Yzöwl
Which key are you checking/changing `"Start Page"=` on?
  • HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main
  • HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Main
  • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main


What is the 'exact string' instead of the following?
  • http://old_intranet
  • http://new_intranet


Although you can change the key to suit, the URL string could be more important to the formation of an appropriate script solution than you may think!
tekniik
Thanks, I am looking to replace:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main

The old site is listed as http://luceweb and the new site is http://lucenet.

Thanks!
Yzöwl
Something along these lines should get you there:
CODE
@Echo off&Setlocal

Set K_="HKCU\Software\Microsoft\Internet Explorer\Main"
Set V_="Start Page"
Set O_=luceweb
Set N_=http://lucenet

Reg query %K_% /v %V_%|Find "%O_%">Nul 2>&1&&(
    Reg add %K_% /v %V_% /d "%N_%" /f>Nul)
tekniik
Tested on a few machines and it worked great.

Thank You!!! thumbup.gif




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.