Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing %LOGIN_NAME variable from within a batch file

Posted on 1998-12-31
1
Medium Priority
?
501 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
1 Comment
 
LVL 3

Accepted Solution

by:
brosenb0 earned 400 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

963 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