none
Web Page launch at Login

    Question

  • I have a need to launch a Web Site at login with the default browser. 

    I have a GPO that I have added the following setting to:

    User Configuration\Policies\Windows Settings\Scripts\Logon -> added a simple bat file

    BAT file consist of (one line)

    @start http://www.myneededsite.com

    The BAT file is in the default location within SYSVOL and I have verified that the Security Group of which the GPO is applied has READ & EXECUTE for the BAT file.

    My workstation is Windows 10 and it launches fine, no issue at all. I can change default browsers and it launches when I login.

    Almost all my customers are still on Windows 7. They are not launching the Web Site upon login.

    If I set a login script on their AD account to run the BAT file it works, but not through the GPO. 

    Why not? 

    Thursday, September 03, 2015 3:54 PM

Answers

  • Okay, I believe I have it working... This is what I did...

    I use the GPO to insure that my batch file with my one liner in it to open the specific website in the default browser is copied to the %systemroot%. I do this by having my batch file in the default SYSVOL location for scripts. Then on the GPO I goto 'User Configuration > Preferences > Windows Settings > Files'. I create a new file with Action - Update, Source is my batch file in the SYSVOL location, Destination is %systemroot%\batchfile  I also select Suppress errors, just because. I make it Read-only and Hidden. On the Common tab, I select 'Run in logged-on user's security context'  All of this gets the file where I want it on the Users Workstation.

    I then goto 'User Configuration > Policies > Administrative Templates > System > Logon' I enable 'Run these programs at user logon' and I enter my batchfile in the Items to run at logon. I don't need a path because I put the batch file in the %systemroot%.

    Now it works... See, should be simple. (Now that I know what to do.)

    OH, BTW.... If you want/need two tabs open to two different sites (which I do for a remote location), I have a batch file with two lines:

    @start http://www.mysite-1.com

    @start http://www.mysite-2.com

    This opens the default browser with two tabs and the two sites are displayed. 

    Now on with my day... Thanks for your help

    • Marked as answer by Tim Newcomb Friday, September 04, 2015 10:56 AM
    Friday, September 04, 2015 10:56 AM

All replies

  • If you want to use a batch file, then why not point directly to the browser executable and pass the url to it?

    e.g.

    @echo off
    C:\Program Files\Internet Explorer\iexplore.exe "http://somesite.com"

    I've done the same previously but by using GPP, but i guess there are many ways to do it.  I've set a GPP registry value for HKCU\Software\Microsoft\Windows\CurrentVersion\Run for C:\Program Files\Internet Explorer\IEXPLORE.EXE "http://www.somesite.com"

    If this site is also the homepage, you can set a GPO to define the homepage. Then just launch the browser, no need to pass a url.

    It's the same behaviour for Internet Explorer, Chrome and Firefox.


    • Edited by zxxzxx Thursday, September 03, 2015 5:19 PM
    Thursday, September 03, 2015 5:18 PM
  • That basically would launch IE and unfortunately I would cause a fire storm if I forced some users to use IE or to use a browser other than their choice. 

    I am good with the Registry Setting also, but again, I really need it to work with the default browser.

    I would prefer to not have to use a batch file and login script in the GPO, but I need the GPO to set this if possible. Not the end of the world to call a batch / Powershell script to launch the site. Should be a simple thing... 

    Thursday, September 03, 2015 5:38 PM
  • How about the following from Stackoverflow.

    explorer http://technet.microsoft.com
    It uses the default browser for the system.

    • Edited by zxxzxx Thursday, September 03, 2015 7:27 PM
    Thursday, September 03, 2015 7:26 PM
  • Okay, I believe I have it working... This is what I did...

    I use the GPO to insure that my batch file with my one liner in it to open the specific website in the default browser is copied to the %systemroot%. I do this by having my batch file in the default SYSVOL location for scripts. Then on the GPO I goto 'User Configuration > Preferences > Windows Settings > Files'. I create a new file with Action - Update, Source is my batch file in the SYSVOL location, Destination is %systemroot%\batchfile  I also select Suppress errors, just because. I make it Read-only and Hidden. On the Common tab, I select 'Run in logged-on user's security context'  All of this gets the file where I want it on the Users Workstation.

    I then goto 'User Configuration > Policies > Administrative Templates > System > Logon' I enable 'Run these programs at user logon' and I enter my batchfile in the Items to run at logon. I don't need a path because I put the batch file in the %systemroot%.

    Now it works... See, should be simple. (Now that I know what to do.)

    OH, BTW.... If you want/need two tabs open to two different sites (which I do for a remote location), I have a batch file with two lines:

    @start http://www.mysite-1.com

    @start http://www.mysite-2.com

    This opens the default browser with two tabs and the two sites are displayed. 

    Now on with my day... Thanks for your help

    • Marked as answer by Tim Newcomb Friday, September 04, 2015 10:56 AM
    Friday, September 04, 2015 10:56 AM
  • Thank you for sharing your solutions and experience here Tim.
     
    It will be very beneficial for other community members who have similar questions.
     

    Regards,

    Ethan Hua


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    Monday, September 07, 2015 6:38 AM
    Moderator