Help with login script

Discussion in 'OT Technology' started by AbortionSurvivor, Aug 11, 2004.

  1. AbortionSurvivor

    AbortionSurvivor Active Member

    Joined:
    Jun 5, 2002
    Messages:
    3,016
    Likes Received:
    0
    Location:
    Nor. Cal
    I'm new to scripts. What I want to do is have the user run a specific file when the user logs into the domain. The sever is Win2k.

    I have created a "Hello world" type script, but it doesn't execute when the user logs in. It works would I double click it.

    I would like to know where in the profile manager do I add the instruction to run the script. And it would be great if someone knew the code to run a specific executable upon login. Thanks!
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Active Directory Domain Users And Computers->Right Click your Domain Name on the left, Properties, Group Policies Tab. You can then manage it by user, domain users, etc... If you click Edit Policy it brings up the Group Policy Box. Then it's under User->scripts (logon/logoff). Keep in mind that drive letters are not known so use UNC paths to access network resources. Also, they're not meant to be interactive so a better example of whether its working or not is to simply type:

    Echo Hello World! >c:\test.txt

    as the batch file. This should create a text file on the root of C with Hello World in it.
     
  3. AbortionSurvivor

    AbortionSurvivor Active Member

    Joined:
    Jun 5, 2002
    Messages:
    3,016
    Likes Received:
    0
    Location:
    Nor. Cal
    I've added my script to the list of where you said "User->scripts (logon/logoff)"
    Now i only want to test this out on myself first. How do i specify for me to run this next time i logon. sorry for the newbie question
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Well you needed to create another policy group. If all you did is changed the default Domain User Policy, you've basically made everyone run that script. You can also run individual scripts - put the script in the same location but go into individual user - there's a spot for scripts there too (under profile tab).
     
  5. AbortionSurvivor

    AbortionSurvivor Active Member

    Joined:
    Jun 5, 2002
    Messages:
    3,016
    Likes Received:
    0
    Location:
    Nor. Cal
    I created another policy group, but your 2nd suggestion sounds good.

    I went to the profile setup for my user. Now i see two target location boxes 'Profile Path' and 'Logon script'. I'm assuming point "Logon script" to the location of the script file i want to run. right?

    I tried that earlier with no luck. Is the file location of the script relative to the user or the server? For example, if i were the user, i could get to the script by going to \\<server name>\public\logon.bat
    On the relative file location to the server would be d:\public\logon.bat
     
  6. Scoob_13

    Scoob_13 Anything is possible, but the odds are astronomica

    Joined:
    Oct 5, 2001
    Messages:
    73,796
    Likes Received:
    38
    Location:
    Fort Worth. Hooray cowgirls.
    It's relative to the user, however if you simply use UNC pathing it wouldn't make a bit of difference in either case.
     
  7. AbortionSurvivor

    AbortionSurvivor Active Member

    Joined:
    Jun 5, 2002
    Messages:
    3,016
    Likes Received:
    0
    Location:
    Nor. Cal
    No luck. Is there anything in the script file i need to add?
    I just have
    Echo Hello World! >c:\test.txt

    I checked for the output and the file wasn't even created.

    Edit: the script does work if I manual find the file and double-click it.
     
  8. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Try putting the script in the default location - can't remember but I thought there was some special permissions for logon users in that location (because you may not "technically" have rights yet).
     

Share This Page