Solved

Accessing %LOGIN_NAME variable from within a batch file

Posted on 1998-12-31
1
494 Views
Last Modified: 2008-03-17
I have written a batch file that checks for the existance of a file on a users hard drive.  If it doesn't find the file, I want it to create a file on a server that is named after the user's Netware login name.  I know that you can use %LOGIN_NAME in scripts, but how can I access that same variable information from within a batch file?
0
Comment
Question by:tdiamond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
brosenb0 earned 100 total points
ID: 1594553
In your login script set an environment variable to the user's login name, eg.
Dos Set NetUser = %LOGIN_NAME

In your batch file you can now use %NetUser for whatever you want.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question