AutoHotkey Community

It is currently May 27th, 2012, 7:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Retrieve information
PostPosted: October 8th, 2006, 1:53 pm 
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

Image
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 :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 8th, 2006, 2:18 pm 
There is a built-in Windows variable for that

Code:
msgbox %computername%


Report this post
Top
  
Reply with quote  
 Post subject: Re: Retrieve information
PostPosted: October 8th, 2006, 2:37 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Retrieve information
PostPosted: October 8th, 2006, 2:56 pm 
Thank you


Report this post
Top
  
Reply with quote  
 Post subject: User name
PostPosted: November 4th, 2006, 2:49 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject: Found it
PostPosted: November 4th, 2006, 2:54 pm 
Hi

Sorry to waste your time - I found it:

Msgbox %A_UserName%

Thanks anyway


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 4th, 2006, 2:57 pm 
Offline

Joined: August 15th, 2005, 7:15 am
Posts: 107
Location: North Carolina
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: User name
PostPosted: November 4th, 2006, 2:58 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Jason T. wrote:
I really like the %computername% command - but where do you find out about this?


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

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: User name
PostPosted: November 4th, 2006, 7:49 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, HotkeyStick, just me, migz99 and 71 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group