Ask the Expert

Can the variables %homepath% and %username%. be used in a login script file?

I have read all about the environmental variables such as %homepath% and %username%. Can either of these variables be used in a login script (.bat) file? I have tried every possible combination. If it can be done, what is the syntax? The profiles tab in the ADS for users has the homepath as serverdiruser. Obviously I am trying to map a drive letter to serverdiruser, where each user is unique.

Requires Free Membership to View

It all depends on what user context the batch file runs in. If the batch file is kicked off in the LOCAL_SYSTEM account, those environment variables won't be defined. However, if the batch file is started from the user's account, simply specify them like SERVER%USERNAME%.

This was first published in March 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: