desktop@mst.edu

 
Google
mst.edu Desktop Engineering Docs
Installer Documentation User Documentation Developer Documentation Links

Login / Logoff / Startup / Shutdown Scripts for the Windows Installs

by the Desktop Engineering Group

Last Reviewed 8/15/2008

 

At the time a user logs into the machine, The group policy set on the OU where the computer object is located calls three login scripts at login (in the order shown below):

 

1) The location of the All Users Login Script named login.cmd is here:

  • %ALLUSERSPROFILE%\MST\standard\login\login.cmd

 

2) The location of the optional user customized login script for desktop machines is here:

  • %USERPROFILE%\scripts\userlogin.cmd

 

3) The location of the network userlogin script for desktop and CLC machines is here:

  • \\minerfiles.mst.edu\dfs\users\<userID>\scripts\userlogin.cmd.

This is accessible to the user via the location S:\scripts\userlogin.cmd. Note that it is necessary for the mstloginscripts v2.7 (7/21/2008) or higher package to be installed on the machine to allow this script to be called by Active Directory:

 

All Users Login Script Information

The All Users Login script (login.cmd) runs the file %ALLUSERSPROFILE%\MST\standard\login\drivemap.pl, which maps various system and user drives. The script waits for several network-related services to start and will time out after two minutes. If they do not all start within the timeout, the machine is assumed to be offline and the script does nothing more. Any drives that were mapped when the machine was online remain so, but in a disconnected state. If the machine gets online at a later time browsing into the drive will reconnect to the server.

When a user logs in, %ALLUSERSPROFILE%\MST\standard\login\systemdrives.txt is processed. It currently maps the following drive letters:

  • R: \\minerfiles.mst.edu\dfs
  • S: \\minerfiles.mst.edu\dfs\users\%USERNAME%
  • W: \\minerfiles.mst.edu\dfs\userweb\%USERNAME%
  • Y: \\minerfiles.mst.edu\dfs\dept

NOTE: Please don't change the drive letters/UNC paths of the four standard system drives. Feel free to add any drives that are needed system-wide, but don't override the standard drive letters. This will likely cause problems in the future.

 

When a member of cc-installer logs in, the file C:\Documents and Settings\All Users\MST\standard\login\installerdrives.txt is processed. It currently maps the following drive letters:

  • K: \\minerfiles.mst.edu\dfs\software\itwindist
  • L: \\minerfiles.mst.edu\dfs\software\clcimages
  • M: \\minerfiles.mst.edu\dfs\software\desktopimages

 

If it exists, C:\Documents and Settings\<userid>\userdrives.txt is processed. By default it does not exist and nothing else is mapped. If the path for a drive letter is changed, logging out and logging back in will remap the new path. Duplicate drive letter mappings are detected and reported in the event log. Correct mappings are left in place. Orphaned drive letters with no corresponding entry in any of the configuration files are left unchanged.

 

Examples of drive mappings in these files:

Preferred format - drive letter is mapped to a fully qualified path in DFS:

  • K: \\minerfiles.mst.edu\dfs\software\itwindist

This works for other environment variables, too:

  • S: \\minerfiles.mst.edu\dfs\users\%username%

This format works but is not recommended by the desktop engineering team:

  • Y: R:\dept

Note: Lines which include the '#' symbol and lines which don't include the proper formatting are treated as comments, which means that any drive mappings included on those lines are skipped:

  • # K: \\minerfiles.mst.edu\dfs\users

 

Messages generated by the Drivemap.pl script are logged to the Application Event Log with IDs 900-909

900. A File containing drive mappings was not found.

901. A drive was already specified in a preceeding file and was ignored.

902. At least one networking service failed to start in two minutes

903. Machine is connected to UMR and drive mappings will be processed.

904. User is a member of cc-installer and the installer drives will be mapped

905. An incorrect mapping was successfully unmapped

906. An incorrect mapping could not be unmapped

907. Successfully mapped a drive

908. A drive could not be mapped

909. A correct drive and path already mapped

 

All Users Logoff Scripts

These scripts are called by Active Directory, but are currently not doing anything:

  • Logoff Script:  %ProgramData%\mst\standard\login\logoff.cmd

 

All Users Startup and Shutdown Scripts

These scripts are called by Active Directory, but are currently not doing anything.

  • Startup Script:  %SystemRoot%\system32\umrinst\scripts\startup.cmd
  • Shutdown Script:  %SystemRoot%\system32\umrinst\scripts\shutdown.cmd

 

User Customized Login Script Information

This is an optional file that can be created by the user. It is stored in this location and will run one when the user logs in:

  • %USERPROFILE%\scripts\userlogin.cmd

Userlogin.cmd is run in a non-interactive invisible window. The current working directory (e.g., for relative paths) of userlogin.cmd is %WINDIR%. Login Scripts run asynchronously from Windows Explorer. This means that the OS does not wait for the login scripts to finish before starting Windows Explorer. Current User registry updates that affect Windows Explorer that are changed after Windows Explorer starts will not take effect until the next time that Windows Explorer starts. Users can login to Windows at a time when the network is not yet available (using cached credentials). To give the login scripts a chance to run, script #3 above waits for the network to become available before processing the network userlogin.cmd script.

 


Please note:  All documentation becomes dated, and this document is no exception.  Desktop Engineering Tools and Documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document.  Please refer to our web site to obtain the latest documentation available.

If you experience problems with the contents of these web pages, please visit the IT Solution Center and submit a ticket with information relevant to the problem.