MSFN Forum: Batch file question - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Batch file question Rate Topic: -----

#1 User is offline   tekniik 

  • Group: Members
  • Posts: 3
  • Joined: 29-July 09

Posted 29 July 2009 - 02:15 PM

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

This post has been edited by tekniik: 29 July 2009 - 02:16 PM



#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,115
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 29 July 2009 - 03:44 PM

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?

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!

#3 User is offline   tekniik 

  • Group: Members
  • Posts: 3
  • Joined: 29-July 09

Posted 29 July 2009 - 03:56 PM

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!

#4 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,115
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 29 July 2009 - 05:13 PM

Something along these lines should get you there:
@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)


#5 User is offline   tekniik 

  • Group: Members
  • Posts: 3
  • Joined: 29-July 09

Posted 29 July 2009 - 05:53 PM

Tested on a few machines and it worked great.

Thank You!!! :thumbup

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy