JSI Tip 0273 - Little known DOS trick assists logon script.

Jerold Schulman

October 5, 1997

1 Min Read
ITPro Today logo in a gray background | ITPro Today

When you write a logon script, the batch file can not determine where it is running from and different clients point the current directory to various places. A little known DOS trick can prevent you from having to hard code the directory and have different scripts for different servers.

Use %0..<filename> syntax in your logon script. A simple example can been seen at tip 120 where the following code is used to invoke Kix32:

@echo off
%0..KIX32 LOGON
Exit

This works with all client systems an tells the client that the KIX32 program is located in the NetLogon share.

See tip 523.

NOTE: When the %0 variable is expanded in Windows XP, the result is enclosed in quotation marks.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like