| View previous topic :: View next topic |
| Author |
Message |
Jason T. Guest
|
Posted: Sun Oct 08, 2006 1:53 pm Post subject: Retrieve information |
|
|
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  |
|
| Back to top |
|
 |
not-logged-in-daonlyfreez Guest
|
Posted: Sun Oct 08, 2006 2:18 pm Post subject: |
|
|
There is a built-in Windows variable for that
| Code: | | msgbox %computername% |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Sun Oct 08, 2006 2:37 pm Post subject: Re: Retrieve information |
|
|
| 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,  _________________
 |
|
| Back to top |
|
 |
Jason T Guest
|
Posted: Sun Oct 08, 2006 2:56 pm Post subject: Retrieve information |
|
|
| Thank you |
|
| Back to top |
|
 |
Jason T. Guest
|
Posted: Sat Nov 04, 2006 2:49 pm Post subject: User name |
|
|
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
|
Posted: Sat Nov 04, 2006 2:54 pm Post subject: Found it |
|
|
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
|
Posted: Sat Nov 04, 2006 2:57 pm Post subject: |
|
|
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.
Best,
Bob |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Sat Nov 04, 2006 2:58 pm Post subject: Re: User name |
|
|
| 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 |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Sat Nov 04, 2006 7:49 pm Post subject: Re: User name |
|
|
| 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 |
|
 |
|