+ Post New Thread
Results 1 to 6 of 6
Windows Thread, Startup Script in Technical; I want to apply some registry settings at startup. I've dumped the reg files in the netlogon folder and created ...
  1. #1

    Join Date
    Jun 2008
    Posts
    718
    Thank Post
    119
    Thanked 64 Times in 52 Posts
    Rep Power
    31

    Startup Script

    I want to apply some registry settings at startup.

    I've dumped the reg files in the netlogon folder and created a bat file to call the reg files.

    Code:
    @echo off
    %windir%\regedit.exe /s %logonserver%\netlogon\StartupScripts\PR2.REG
    %windir%\regedit.exe /s %logonserver%\netlogon\StartupScripts\DisableLogonDialup.REG
    The bat file resides in one of the GPO under startup and is meant to call the reg files, but it doesn't.

    A few days ago some members had fixed this for me to get other other reg file to work under logon.

    Can I just add that if I run the bat file manually after logging in, it works. Why doesn't it just work when the PC is booted up and it's at the "Running start up scripts" stage?

    Do I need to do anything different?

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Because you're running this script in the machine context, not a user's, the %LOGONSERVER% variable expands to nothing. You can use the format \\domain.local\netlogon to pick a server from amongst your domain if that's what you're trying to do.
    Last edited by powdarrmonkey; 25th February 2009 at 06:49 PM.

  3. Thanks to powdarrmonkey from:

    Chuckster (26th February 2009)

  4. #3

    Join Date
    Jun 2008
    Posts
    718
    Thank Post
    119
    Thanked 64 Times in 52 Posts
    Rep Power
    31
    Thanks a million! That worked.

    Am I right to assume that the %logonserver% variable works only on logon and that you need to incorporate the 'domain.local' if it's a startup script?

    For example...

    Logon
    Code:
    @echo off
    %windir%\regedit.exe /s %logonserver%\netlogon\StartupScripts\PR.REG

    Startup
    Code:
    @echo off
    %windir%\regedit.exe /s \\schoolname.local\netlogon\StartupScripts\DisableLogonDialup.REG

  5. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,341
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414
    no %logonserver% only works when a user logs on.

    Ben

  6. Thanks to plexer from:

    Chuckster (26th February 2009)

  7. #5

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,069
    Thank Post
    853
    Thanked 2,675 Times in 2,269 Posts
    Blog Entries
    9
    Rep Power
    768
    Because the machines are on the domain the netlogon share should be accessable from under the netbios domain name just like a DFS root so you may be able to use this \\%userdomain% depending on whether the machine accounts domain information is avalible at the time.

  8. Thanks to SYNACK from:

    Chuckster (26th February 2009)

  9. #6

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by Chuckster View Post
    Thanks a million! That worked.

    Am I right to assume that the %logonserver% variable works only on logon and that you need to incorporate the 'domain.local' if it's a startup script?
    %LOGONSERVER% expands to the specific server the machine picked as the user logged in, in flat format (open a command prompt and say "echo %LOGONSERVER%" to see it). If you give a fully-qualified domain name, Windows picks a server from the available pool of DCs, as a rough sort of load-balancing.

    Therefore, you can use a FQDN in either sort of script, but %LOGONSERVER% in a login script only.


    Edit: sorry, I started typing this before I had my break, so it took forever and you have three answers now

  10. Thanks to powdarrmonkey from:

    Chuckster (26th February 2009)

SHARE:
+ Post New Thread

Similar Threads

  1. Installing GoogleSketchup 6 via startup script
    By markwilliamson2001 in forum Windows
    Replies: 3
    Last Post: 4th March 2008, 07:26 PM
  2. Detecting/Disabling ICS in a Startup script
    By Geoff in forum Network and Classroom Management
    Replies: 5
    Last Post: 7th February 2008, 05:27 PM
  3. RM CC3 Startup Script
    By randle in forum Windows
    Replies: 4
    Last Post: 30th July 2007, 02:56 PM
  4. Startup script time-out gotcha aargh!!
    By NetworkGeezer in forum Windows
    Replies: 7
    Last Post: 1st June 2006, 05:13 PM
  5. Loading .reg files in a startup script
    By Ric_ in forum Windows
    Replies: 7
    Last Post: 27th September 2005, 04:23 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •