Share via


Using login.cmd

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Using login.cmd

The program login.cmd is run whenever someone logs on to Telnet Server. You can edit the login.cmd file to change the text that appears when someone logs on, and you can use login.cmd to run other programs.

When Telnet Server is installed, the program is copied to %SystemRoot%\system32\login.cmd. This is what it looks like:

@echo off
rem
rem  Default global logon script for the Telnet Server
rem
rem  In the default setup, this command script is run
rem  when the initial command shell is invoked. It, in
rem  turn, will try to invoke the individual user's
rem  logon script.
rem
echo 
*====================================================
echo
Welcome to Microsoft Telnet Server.
echo
*===============================================
cd /d %HOMEDRIVE%\%HOMEPATH%

In the following example, the file has been edited to display the text "Welcome to my Telnet Server," and run net config to display information about the server configuration:

@echo off
rem
rem  Default global logon script for the Telnet Server
rem
rem  In the default setup, this command script is run 
rem  when the initial command shell is invoked. It, in
rem  turn, will try to invoke the individual user's
rem  logon script.
rem
echo 
*================================================
echo
Welcome to my Telnet Server
echo 
*================================================
cd /d %HOMEDRIVE%\%HOMEPATH%net config server