# Get user login name from MEL?

**URL:** https://forum.highend3d.com/t/get-user-login-name-from-mel/5378
**Category:** Maya
**Tags:** mel
**Created:** [April 13, 2003, 4:15pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378 "2003-04-13T16:15:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![samgtn](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@samgtn](https://forum.highend3d.com/u/samgtn)
#### Post date: [April 13, 2003, 4:15pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378/1 "2003-04-13T16:15:27Z")

</div>

Is there a way for MEL to retrieve the name of the currently logged in user under windows?

---

<div class="post-metadata">

### Author: ![goggle](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@goggle](https://forum.highend3d.com/u/goggle)
#### Post date: [April 13, 2003, 5:26pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378/2 "2003-04-13T17:26:10Z")

</div>

If you're on Unix or Windows with the Tcsh shell installed, you can do a system call to the 'whoami' command. Don't know if there's an equivalent default windows command.

Hope this helps.

-James

---

<div class="post-metadata">

### Author: ![gmask](https://forum.highend3d.com/user_avatar/forum.highend3d.com/gmask/32/192_2.png) [@gmask](https://forum.highend3d.com/u/gmask)
#### Post date: [April 13, 2003, 6:16pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378/3 "2003-04-13T18:16:20Z")

</div>

whoami works in the NT console

---

<div class="post-metadata">

### Author: ![gdc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gdc](https://forum.highend3d.com/u/gdc)
#### Post date: [April 13, 2003, 9:16pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378/4 "2003-04-13T21:16:01Z")

</div>

you could use:  
getenv "USER";

On windows this returns the name of the person logged in.

--g

---

<div class="post-metadata">

### Author: ![markwilkins](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@markwilkins](https://forum.highend3d.com/u/markwilkins)
#### Post date: [April 15, 2003, 4:03pm UTC](https://forum.highend3d.com/t/get-user-login-name-from-mel/5378/5 "2003-04-15T16:03:28Z")

</div>

getenv "USER"

works on all platforms on which Maya runs.

-- Mark
