Solved

Accessing %LOGIN_NAME variable from within a batch file

Posted on 1998-12-31
1
481 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 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now