Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Current User? My Computer?


  • Please log in to reply
13 replies to this topic
Robbo
  • Members
  • 47 posts
  • Last active: Feb 22 2011 09:16 AM
  • Joined: 27 Jul 2008
How can I find out what the current user is called?

What I'm trying to do is when you press a button it opens up "My Documents". The command "Run My Documents" obviously doesn't work so I'm presuming you'd have to specify the full path.
"Run C:\Documents and Settings\%User's Name%\My Documents". If some one can get the user's name into a variable I'd be grateful!
All scripts are untested unless otherwise mentioned.

DHMH
  • Members
  • 230 posts
  • Last active: Mar 25 2012 10:34 AM
  • Joined: 17 Jul 2008
Try the in-built variable A_UserName :
MsgBox, You Username is %A_UserName%

or you can use the variable A_MyDocuments:
MsgBox, Your Document's folder is located here: %A_MyDocuments%

Greets,
DHMH

Robbo
  • Members
  • 47 posts
  • Last active: Feb 22 2011 09:16 AM
  • Joined: 27 Jul 2008
Thanks, that's great!
All scripts are untested unless otherwise mentioned.

Robbo
  • Members
  • 47 posts
  • Last active: Feb 22 2011 09:16 AM
  • Joined: 27 Jul 2008
Umm... I feel really stupid now :?
How can I do the same for "My Computer"? This time I just want to "Run My Computer" but again that doesn't work (of course). Any help with it?

Thanks in advance...
All scripts are untested unless otherwise mentioned.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Refer AHK Doc for Run command, where you will find:

Run ::{20d04fe0-3aea-1069-a2d8-08002b30309d}   ; Opens the "My Computer" folder.

kWo4Lk1.png

Robbo
  • Members
  • 47 posts
  • Last active: Feb 22 2011 09:16 AM
  • Joined: 27 Jul 2008
Again thanks, I'm working on a big script right now so I might be asking for some more stuff later! :?
All scripts are untested unless otherwise mentioned.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Again thanks, I'm working on a big script right now so I might be asking for some more stuff later!



no problem.

:?


Why? Are you not happy that I had given you the quick/right answer?
I had asked you to refer Run command so that you will know about CLSID's and would land on <!-- m -->http://www.autohotke.../CLSID-List.htm<!-- m -->

:)

Robbo
  • Members
  • 47 posts
  • Last active: Feb 22 2011 09:16 AM
  • Joined: 27 Jul 2008
No, I wrote :? because I don't like the fact I'll probably have to ask for more help with other stuff. What you gave me was great!
All scripts are untested unless otherwise mentioned.

lemario
  • Members
  • 8 posts
  • Last active: Nov 30 2014 07:25 PM
  • Joined: 19 Nov 2014

i need to do a if statement witch compares the current user with a string. how do i do it?



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
if (A_username = "string")
    Msgbox the user is = string!

Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

lemario
  • Members
  • 8 posts
  • Last active: Nov 30 2014 07:25 PM
  • Joined: 19 Nov 2014

Thank you for the quick answer :) :) It helped tons



lemario
  • Members
  • 8 posts
  • Last active: Nov 30 2014 07:25 PM
  • Joined: 19 Nov 2014

quick question really of topic. Is there a way that when i run the exe it does not apear a "mini icon" in the right down corner?



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012

You don't need to run an exe you can run the scripts without compiling

 

but you can do #NoTrayIcon http://ahkscript.org..._NoTrayIcon.htm


Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

lemario
  • Members
  • 8 posts
  • Last active: Nov 30 2014 07:25 PM
  • Joined: 19 Nov 2014

I know. But im doing things with utilman. It needs to be a exe. THX :) (sorry for the oftopic admins)