Creating and Designing Login Scripts
When logging onto the network, it runs the login script, which does useful stuff like detects which computer the user has logged onto, then finds the closest printer. To design and develop a login script would mean to have a good understanding of command prompt and a scripting language for batch files like PHP. A batch file name that has helped set up computers for a long time is named “autoexec.bat” and is still present in the current Windows system. In a batch file, every line is a comment or command. A comment is used to explain sections of the batch files, so what parts of the script does. A command could be from the scripting language or actual commands that are typed into the command prompt. This is good because programs and utilities (e.g. ipconfig) are command line driven. To create a login script, open Notepad, add the command prompts, and finally save as a .bat file. Some commands are:
“rem” to start a comment
“ipconfig> “%userprofile%\ipconfig.txt”” to run the ipconfig program and send the output from this into a text file in the user profile named ipconfig.txt
“echo” to show the words on the screen
“findstr “192.168.22.254” “%userprofile%\ ipconfig.txt” to look for 192.168.22.254 in the text file named ipconfig.txt in the user profile, setting errorlevel to 1 if not found
“if not errorlevel 1 goto UK” to jump to the label UK if appropriate
“goto next” to jump to the next label