+ Post New Thread
Results 1 to 12 of 12
Windows Thread, Login script - first attempt in Technical; Never applied a login script before, has any one got a template of theirs I could take a look at? ...
  1. #1

    Join Date
    Jun 2008
    Posts
    21
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Login script - first attempt

    Never applied a login script before, has any one got a template of theirs I could take a look at?

    So I could get a better understanding.

  2. #2


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 433 Times in 352 Posts
    Rep Power
    126
    What do you want it to do?

  3. #3

    Join Date
    Jun 2008
    Posts
    21
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Map appropiate drives when user logs on

  4. #4

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,248
    Thank Post
    1,059
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740
    Here you are, a basic example.

    Code:
    @echo off
    @echo Welcome to the School Network
    net time \\stjohns01 /set /yes
    
    if %OS%==Windows_NT goto NTWKS
    
    net use n: /home
    net use p: \\stjohns01\apps
    net use g: \\stjohns01\cse$
    net use v: \\stjohns01\cdcache
    g:
    cd profiles\kix32
    kix32 students.txt
    c:
    net use g: /d /y
    net use f: \\stjohns01\cse$
    goto end
    
    :NTWKS
    
    net use f: \\stjohns01\cse$ /PERSISTENT:NO
    net use P: \\stjohns01\apps /PERSISTENT:NO
    net use V: \\stjohns01\cdcache /PERSISTENT:NO
    net use r: \\stjohns01\resource$ /PERSISTENT:NO
    net use s: "\\stjohns01\Shared Areas" /PERSISTENT:NO
    net use w: \\stjohns01\work /PERSISTENT:NO
    net time \\stjohns01 /set /yes
    "tsc killer.exe"
    gpupdate
    :END

  5. #5

    Join Date
    Jun 2008
    Posts
    21
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Thanks Matt, what does the cdcache part do?


    net use v: \\stjohns01\cdcache


    Whats happening exactly with this part?

    :NTWKS

    net use f: \\stjohns01\cse$ /PERSISTENT:NO
    net use P: \\stjohns01\apps /PERSISTENT:NO
    net use V: \\stjohns01\cdcache /PERSISTENT:NO
    net use r: \\stjohns01\resource$ /PERSISTENT:NO
    net use s: "\\stjohns01\Shared Areas" /PERSISTENT:NO
    net use w: \\stjohns01\work /PERSISTENT:NO
    net time \\stjohns01 /set /yes
    "tsc killer.exe"
    gpupdate
    :END

  6. #6
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,159
    Thank Post
    319
    Thanked 311 Times in 217 Posts
    Rep Power
    124
    If you want a complex VBS loging script, i have got one, which all staff have but the script determines what drives they see, which looks at what the user is a member of.

  7. #7
    apoth0r's Avatar
    Join Date
    Apr 2007
    Location
    Northants
    Posts
    1,221
    Thank Post
    151
    Thanked 180 Times in 132 Posts
    Rep Power
    52
    Quote Originally Posted by itman View Post
    Hi Thanks Matt, what does the cdcache part do?


    net use v: \\stjohns01\cdcache


    Whats happening exactly with this part?

    :NTWKS

    net use f: \\stjohns01\cse$ /PERSISTENT:NO
    net use P: \\stjohns01\apps /PERSISTENT:NO
    net use V: \\stjohns01\cdcache /PERSISTENT:NO
    net use r: \\stjohns01\resource$ /PERSISTENT:NO
    net use s: "\\stjohns01\Shared Areas" /PERSISTENT:NO
    net use w: \\stjohns01\work /PERSISTENT:NO
    net time \\stjohns01 /set /yes
    "tsc killer.exe"
    gpupdate
    :END
    Refers to the resource folder on the stjohns01 server (i'd assume a store of ISO's and copies of CD resources)

  8. #8

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,248
    Thank Post
    1,059
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740
    Quote Originally Posted by itman View Post
    Hi Thanks Matt, what does the cdcache part do?


    net use v: \\stjohns01\cdcache


    Whats happening exactly with this part?

    :NTWKS

    net use f: \\stjohns01\cse$ /PERSISTENT:NO
    net use P: \\stjohns01\apps /PERSISTENT:NO
    net use V: \\stjohns01\cdcache /PERSISTENT:NO
    net use r: \\stjohns01\resource$ /PERSISTENT:NO
    net use s: "\\stjohns01\Shared Areas" /PERSISTENT:NO
    net use w: \\stjohns01\work /PERSISTENT:NO
    net time \\stjohns01 /set /yes
    "tsc killer.exe"
    gpupdate
    :END
    cdcache part maps a drive to a share that I have called cdcache. I managed to get some old CD rom stuff working over the network. Tizzy's toy box etc...

    The other parts are again drive mapping to various shares, then a time sync with the DC, a script which kills Trend's tsc.exe if its running, a policy update, then dinner, lunch, tea, supper and a pint of beer, jumpers for goalposts, 'Its getting a bit busy in this forum Maureen.....' Wooooohhhh, slow down there Matt.......

  9. #9

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,485
    Thank Post
    372
    Thanked 657 Times in 537 Posts
    Rep Power
    162
    Quote Originally Posted by mattx View Post
    Code:
    gpupdate
    :END
    Bit useless... it just updated!! This might cause errors as well.

  10. #10
    Irazmus's Avatar
    Join Date
    Feb 2006
    Location
    Suffolk
    Posts
    320
    Thank Post
    13
    Thanked 22 Times in 17 Posts
    Rep Power
    23
    This is ours (slightly simplified and domain changed), which gets applied to all users.

    It uses AD group membership to determine what gets set, and controls everything from IE proxy settings to mapped drives and printers to desktop backgrounds.

    At 360 lines it may seem a little excessive, but it works well for us.
    Attached Files Attached Files

  11. #11

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,485
    Thank Post
    372
    Thanked 657 Times in 537 Posts
    Rep Power
    162
    Personally you need to learn how to use GP

    Nice script none the less!

    Just shame it's not strict, full vb .net and you've got "On Error Resume Next"

  12. #12

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,248
    Thank Post
    1,059
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740
    Quote Originally Posted by matt40k View Post
    Bit useless... it just updated!! This might cause errors as well.
    It's refreshing the policy, not updating it. As you already most proably know the policy will update every few hours [ or what ever time limit the admin has set ] whilst a user is logged on to the domain.



SHARE:
+ Post New Thread

Similar Threads

  1. Printers disappearing after login script
    By gshaw in forum Windows
    Replies: 11
    Last Post: 10th June 2009, 07:47 PM
  2. Mac Login Script
    By gybe78 in forum Mac
    Replies: 2
    Last Post: 9th September 2008, 11:51 AM
  3. Script visibility after login
    By Blind in forum Scripts
    Replies: 5
    Last Post: 21st April 2008, 12:03 PM
  4. Vista + VB login script
    By dave.81 in forum Windows Vista
    Replies: 5
    Last Post: 17th February 2008, 05:29 PM
  5. Login script problem
    By SpuffMonkey in forum Windows
    Replies: 55
    Last Post: 4th February 2006, 10:27 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
  •