How to show Windows computer name in the taskbar

4
(1)

Let’s show Hostname in the Taskbar

Helpdesk and support administrators have to know on which computer the employee is currently working on. Windows does not display the Computer name on desktop, it’s need for a trip to the system settings, or you have to typing commands in the prompt.

An easy way to display computer names in the taskbar is to create a new toolbar, but before that a folder must be created, which is created by run the following command in a command prompt opened with Win+Rcmd.

mkdir %APPDATA%\%COMPUTERNAME%

Now click the right mouse button in the taskbar and choose Toolbars here select New toolbar…

in the taskbar and choose Toolbars here select New toolbar

In the address field enter %APPDATA% as the path and select the folder with the computer name in Choose a folder window, now click the Select Folder button.

New Toolbar Choose a folder

Now the computer name appears already in the taskbar, if the taskbar is not fixed, with right-click fix taskbar, the toolbar with the computer name can be brought to the desired position.

In addition, status information about the authenticated user can be displayed. Insert the following lines into a batch file and call them in the netlogon script.

@echo off
IF NOT EXIST %APPDATA%\%COMPUTERNAME%\ (
mkdir %APPDATA%\%COMPUTERNAME%
) ELSE (
echo Directory %COMPUTERNAME% exist
)
PowerShell -ExecutionPolicy Unrestricted -Command "Get-NetIPAddress | Select-Object InterfaceIndex,InterfaceAlias,IPAddress | Sort-Object -Property InterfaceIndex | Out-File -FilePath $env:APPDATA\$env:COMPUTERNAME\$env:USERNAME.txt"
PowerShell -ExecutionPolicy Unrestricted -Command "Get-PSDrive | Where {$_.Free -gt 0} | Out-File -Append -FilePath $env:APPDATA\$env:COMPUTERNAME\$env:USERNAME.txt"
wmic useraccount where (name='%username%' and domain='%userdomain%') get domain,name,sid >> %APPDATA%\%COMPUTERNAME%\%USERNAME%.txt

A PowerShell Script Set-StatusToolbar.ps1 creates the directory and file identical to the batch above.

$DirToCreate="$env:APPDATA\$env:COMPUTERNAME"
if (!(Test-Path $DirToCreate -PathType Container)) {
New-Item -ItemType Directory -Force -Path $DirToCreate
}
$ifcfg=(Get-NetIPAddress | Select-Object InterfaceIndex,InterfaceAlias,IPAddress | Sort-Object -Property InterfaceIndex);
$drive=(Get-PSDrive | Where {$_.Free -gt 0});
$usrid=([wmi] "win32_userAccount.Domain='$env:UserDomain',Name='$env:UserName'");
$ifcfg | Out-File -FilePath $env:APPDATA\$env:COMPUTERNAME\$env:USERNAME.txt
$drive | Out-File -Append -FilePath $env:APPDATA\$env:COMPUTERNAME\$env:USERNAME.txt
$usrid | Out-File -Append -FilePath $env:APPDATA\$env:COMPUTERNAME\$env:USERNAME.txt

Run the PowerShell script .\Set-StatusToolbar.ps1

How useful was this post?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *