Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set variables in logon script

Status
Not open for further replies.

nlambron

MIS
May 10, 2002
1
US
I'm converting from a Novell server to Win2k. I need to setup some environmental variables when a user logs on. For instance:
set cobdir = g:\data
I need to assign the variable "cobdir" to be "g:\data".
I attempted putting the above set command in the logon script but when I went to a command prompt the variable was not set.
In Control Panel, System, I see the Environment Variable options, but am not sure how to set this up for all users when they logon.
Thanks for any help.
Nick
 
HI.

What is the OS of client computers?

Your problem is that the login script runs as an instance of COMMAND.COM, but when it terminates Windows "cleans up" that instance.

You might wish to use kixtart instead, it maybe can solve that issue while adding some other login script features as well:

Another option is to add that line to each computer AUTOEXEC.BAT file (for Win9x). This can be done like this in the login script (but I didn't test it):

Login script file:
==================
IF "%COBDIR%"=="" CALL SETVALUE.BAT

SETVALUE.BAT:
=============
ECHO SET COBDIR=G:\DATA >>C:\AUTOEXEC.BAT
ECHO PLEASE REBOOT THE COMPUTER
PAUSE

Bye
Yizhar Hurwitz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top