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 

Retrieve information

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Jason T.
Guest





PostPosted: Sun Oct 08, 2006 1:53 pm    Post subject: Retrieve information Reply with quote

I know there will already be a description of this somewhere in the forum, but I ahven't been able to find it.

Can someone please tell me how to retrieve the "Full computer name"?
i.e. MY COMPUTER - PROPERTIES - COMPUTER NAME


In this example - I want:
305-142-02.capitan.mala.bc.ca

I would like to store it - and use it in a script.

Thank you
Jason

BTW - I really love AHK - hat's off to you guys Very Happy
Back to top
not-logged-in-daonlyfreez
Guest





PostPosted: Sun Oct 08, 2006 2:18 pm    Post subject: Reply with quote

There is a built-in Windows variable for that

Code:
msgbox %computername%
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Sun Oct 08, 2006 2:37 pm    Post subject: Re: Retrieve information Reply with quote

Jason T. wrote:
Can someone please tell me how to retrieve the "Full computer name"?
i.e. MY COMPUTER - PROPERTIES - COMPUTER NAME


Code:
RegRead, FullComp
       , HKEY_LOCAL_MACHINE
       , SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
       , NV Hostname

MsgBox, 4096, Registry Read, Full Computer Name: %FullComp%


Regards, Smile
_________________
Back to top
View user's profile Send private message
Jason T
Guest





PostPosted: Sun Oct 08, 2006 2:56 pm    Post subject: Retrieve information Reply with quote

Thank you
Back to top
Jason T.
Guest





PostPosted: Sat Nov 04, 2006 2:49 pm    Post subject: User name Reply with quote

Hi

I really like the %computername% command - but where do you find out about this?

I searched the help-file but it doesn't look like it has this in it.

Is there one to tell me the "Log on name" of the current user?

I would like to record it - as part of a questionnaire

Thank you

Jason
Back to top
Jason T
Guest





PostPosted: Sat Nov 04, 2006 2:54 pm    Post subject: Found it Reply with quote

Hi

Sorry to waste your time - I found it:

Msgbox %A_UserName%

Thanks anyway
Back to top
Terrapin



Joined: 15 Aug 2005
Posts: 107
Location: North Carolina

PostPosted: Sat Nov 04, 2006 2:57 pm    Post subject: Reply with quote

There are several built-in variables which are automatically set. In the manual, they are at Variables and Expressions. It contains the user name as well. I am not sure, maybe for all, you no longer need the a_ prefix. Computername is listed, for example, as a_computername.

I always think you should inform people when you are collecting data such as this, and ask their permissions. Smile

Best,

Bob
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6084

PostPosted: Sat Nov 04, 2006 2:58 pm    Post subject: Re: User name Reply with quote

Jason T. wrote:
I really like the %computername% command - but where do you find out about this?


Code:
#NoEnv
EnvGet, CompName, computername
MsgBox, % Compname

_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Sat Nov 04, 2006 7:49 pm    Post subject: Re: User name Reply with quote

Jason T. wrote:
I really like the %computername% command - but where do you find out about this?
Win+R, cmd{Enter}, set{Enter}, you get all the names and their values...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   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