get the computer account name

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

get the computer account name

#1 Post by abc0502 » 29 Oct 2011 00:19

is there any way to get the computer account name using a batch file
like getting the name and then set that name to a variable using "set" command

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: get the computer account name

#2 Post by Ed Dyreen » 29 Oct 2011 00:36

'
you mean

Code: Select all

echo.%computername%
?

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: get the computer account name

#3 Post by abc0502 » 29 Oct 2011 00:42

thanks for the quick replay,
i mean to get the user name that you can see in the top of start menu

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: get the computer account name

#4 Post by Ed Dyreen » 29 Oct 2011 00:46

'
intuitive isn't it:

Code: Select all

echo.%username%
:wink:

Code: Select all

@echo off
echo. global variables are:
set
pause
exit /b 0

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: get the computer account name

#5 Post by abc0502 » 29 Oct 2011 00:49

thanks a lot that worked

Code: Select all

echo.%username%

thanks again :D

Post Reply