AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] How to get windows user name

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
hutch@edge.net



Joined: 16 Sep 2008
Posts: 77

PostPosted: Wed Nov 04, 2009 7:33 pm    Post subject: [SOLVED] How to get windows user name Reply with quote

Greetings, Gurus.

I have a short hotstring that enters the date and username into a program when you type "ed{Enter}"

Code:

::ed::  ;;Edit MM/DD by ______.
Send, Edit %A_MM%/%A_DD% by Jack Q. 
Sleep, 100
Send, {F2}
Return


As you can see, it automatically enters the date, based on the current windows date. What I would like to do is, instead of having to edit the script for everyone who may use it, have it also enter the windows user's name. For example, instead of reading "Send, Edit %A_MM%/%A_DD% by Jack Q.", it would be something like, "Send, Edit %A_MM%/%A_DD% by %Current_User%."

Of course, %Current_User% isn't the correct syntax. Can anyone help?


Last edited by hutch@edge.net on Wed Nov 04, 2009 8:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Carcophan



Joined: 24 Dec 2008
Posts: 1308
Location: :noitacoL

PostPosted: Wed Nov 04, 2009 7:36 pm    Post subject: Reply with quote

%A_Username% ?

Quote:

A_ComputerName The name of the computer as seen on the network.
A_UserName The logon name of the current user.

Back to top
View user's profile Send private message
hutch@edge.net



Joined: 16 Sep 2008
Posts: 77

PostPosted: Wed Nov 04, 2009 8:58 pm    Post subject: Reply with quote

That's it!!

Thanks bunches!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group