Who's Current User

coutts
07-05-2005, 12:52 PM
Hi
Can anyone tell me how to programmatically "know" the name of the currently logged on user in Win XP and/or any of the other Windows versions. Maybe I should say why I want to do this. The project is a delayed startup program to stop all the run programs from starting right away but to delay them so the user can get going and start working. Local Machine entries are fine - but I need to work with the Run entries for the current user.

Thanks
Robert

jjStinger72
07-05-2005, 12:56 PM
Environ("USERNAME") will return the value you seek...


Option Explicit

Private Sub cmd_Click()

Debug.Print Environ("USERNAME")

End Sub

coutts
07-05-2005, 01:46 PM
Thank You works great

HoseHead78
07-08-2005, 11:42 AM
What are some of the other Functions for

Environ("USERNAME")


Im mainly looking for the Current users Documents and Settings Folder?
Can you get this by useing this function? or should I just go through the registry.

:: EDIT ::

Found what I was looking for...

Environ("HOMEPATH")

- - - Or - - -

Environ("USERPROFILE")


I found a List of expressions here:
http://www.vbcity.com/forums/topic.asp?tid=47474

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum