Hostname,UserName,S...
 
Notifications
Clear all

We had a major storm through here recently and we suffered damage to the house roof and ceilings. I just received the quote to repair. I’m hoping that a small fraction of the 80,000 odd people that download SDIO and/or Desktop Info every month won’t mind chipping in a few dollars to help out. Click on the big blue button at the bottom of the page to help us keep a roof over our heads, literally!

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Solved] Hostname,UserName,SerialNumber and Model

7 Posts
3 Users
3 Reactions
557 Views
(@vespi)
Active Member Registered
Joined: 5 months ago
Posts: 7
Topic starter  

Hello dear community

I would like to display the following parameters on the desktop:-Hostname(computer name)
-Username
-SerialNumber
-Device model

Somehow nothing is displayed to me via the WMI query.

It returns a value via Powershell
"Get-WmiObject -Class Win32_BIOS | Select-Object -ExpandProperty SerialNumber

# Display computer name
WMI=interval:5,hide-no-result:1,text:Computer Name,namespace:root\cimv2,query:SELECT Name FROM Win32_ComputerSystem,display:%Name%

# Display user name
WMI=interval:5,hide-no-result:1,text:User Name,namespace:root\cimv2,query:SELECT UserName FROM Win32_ComputerSystem,display:%UserName%

# Display serial number
EXTERNAL=interval:10,hide-no-result:1,text:Serial Number,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-SerialNumber.ps1,display:%1

# Display model
EXTERNAL=interval:10,hide-no-result:1,text:Model,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-Model.ps1,display:%1

Complet:

# Desktop Info by Glenn Delahoy
# Sample configuration file
# See the manual for a full description of all options

[options]
# size and position
top=-1
right=0
bottom=0
left=-1
width=340

# font
font-face=Arial
font-size=10

# logging
log=desktopinfo.log
log-level=debugonerror

[screen-saver]
font-face=Comic Sans MS
font-size=16
centerv=1
centerh=1

[text]
noresults=<n/a>
error=[error]
null-result=<null>
unknown=Unknown
executing=<executing>
menu-export=Export
menu-reload=Reload
menu-configuration=Edit Configuration
menu-log=Open Log File
menu-manual=Read Manual
menu-about=About Desktop Info
menu-quit=Quit
nav-previous=Previous Page
nav-home=Home Page
nav-next=Next Page

[items]

# Display computer name
WMI=interval:5,hide-no-result:1,text:Computer Name,namespace:root\cimv2,query:SELECT Name FROM Win32_ComputerSystem,display:%Name%

# Display user name
WMI=interval:5,hide-no-result:1,text:User Name,namespace:root\cimv2,query:SELECT UserName FROM Win32_ComputerSystem,display:%UserName%

# Display serial number
EXTERNAL=interval:10,hide-no-result:1,text:Serial Number,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-SerialNumber.ps1,display:%1

# Display model
EXTERNAL=interval:10,hide-no-result:1,text:Model,command:powershell.exe -NoProfile -ExecutionPolicy Bypass -File Get-Model.ps1,display:%1

Can you please help me?

Thank YOU!


   
Quote
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1501
 

remove the SELECT clause in WMI items, this is implied. On my system Win32_ComputerSystem doesn't return username. You will have more success using the built in items. I don't know where to get the model from in wmi. Sometimes the OEMINFO item will work.

 

# Display computer name
HOST=interval:5,hide-no-result:1,text:Computer Name

# Display user name
USER=interval:5,hide-no-result:1,text:User Name

# Display serial number
WMI=interval:10,hide-no-result:1,text:Serial Number,namespace:root\cimv2,query:win32_BIOS,display:%SerialNumber%

# Display model
OEMINFO=interval:10,hide-no-result:1,text:Model,display:%2

 


   
ReplyQuote
(@vespi)
Active Member Registered
Joined: 5 months ago
Posts: 7
Topic starter  

Thank you for you reply

I tried around and found this solution 😀 

HOST=,text:Hostname: ,display:%1
USER=set:username,text:User: ,display:%1
WMI=:1,text:SN:,,query:Win32_BIOS,display:%serialnumber%
WMI=:1,text:Model:,,query:Win32_ComputerSystem,display:%Model%

Can the text that is displayed on the desktop be marked somehow so that it can then be copied? Maybe via a web link?

This post was modified 5 months ago by Vespi

   
Glenn reacted
ReplyQuote
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1501
 

@vespi Looks good.   No the text cannot be copied.


   
ReplyQuote
(@vespi)
Active Member Registered
Joined: 5 months ago
Posts: 7
Topic starter  

Too bad 🙁 

How do I manage to add one empty line as a distance to the next?


   
ReplyQuote
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1501
 

just add a blank comment item

HOST
COMMENT
USER

   
Vespi reacted
ReplyQuote
RatboyJim
(@ratboyjim)
Eminent Member Registered
Joined: 6 months ago
Posts: 19
 

I use this for vertical spacing. You can vary the height by changing the font size.

COMMENT=font-size:4,text:|


   
Glenn reacted
ReplyQuote
Glenn's Page