Sign in with
Sign up | Sign in
Your question

Last response: in Windows XP
Share
Anonymous
May 6, 2005 11:15:43 AM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

Does anyone know if there is a way to automatically change the computer
description to the name of the user logged on. (using a variable %username%)


Many Thanks

--
miss wje
Anonymous
May 7, 2005 1:31:44 AM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

You may use this script to accomplish the task. Copy the lines below to a
Notepad document and save the file as "PC-Desc.vbs"

------------------------------------------------------------------
Set WshNetwork = WScript.CreateObject("WScript.Network")
MyDesc=WshNetwork.UserName
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Description = MyDesc
objOperatingSystem.Put_
Next

Set WshNetwork = Nothing
------------------------------------------------------------------

When you run the script, it sets the computer description to the currently
logged on user name.

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


"wje" <wje@discussions.microsoft.com> wrote in message
news:9683C05F-9447-4979-A42A-9F06EC9038C3@microsoft.com...
> Does anyone know if there is a way to automatically change the computer
> description to the name of the user logged on. (using a variable
> %username%)
>
>
> Many Thanks
>
> --
> miss wje
!