VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the desktop settings of a specific user using Win32_Desktop WMI class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Tue 11th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the desktop settings of a specific user using Win32_Desktop WMI class

Rate Get the desktop settings of a specific user using Win32_Desktop WMI class



On Error Resume Next
Computer = "."
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_Desktop where Name='KARTHIK\\Administrator'")
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Desktop2.txt", ForAppending, True)
TextFile.WriteLine "Desktop Settings as follows......"
TextFile.WriteLine

For Each Desktop in Items
TextFile.WriteLine "**********************************************************"
TextFile.WriteLine "Name: " & Desktop.Name
TextFile.WriteLine "Border Width: " & Desktop.BorderWidth
TextFile.WriteLine "Cool Switch: " & Desktop.CoolSwitch
TextFile.WriteLine "Cursor Blink Rate: " & Desktop.CursorBlinkRate
TextFile.WriteLine "Drag Full Windows: " & Desktop.DragFullWindows
TextFile.WriteLine "Grid Granularity: " & Desktop.GridGranularity
TextFile.WriteLine "Icon Spacing: " & Desktop.IconSpacing
TextFile.WriteLine "Icon Title FaceName: " & Desktop.IconTitleFaceName
TextFile.WriteLine "Icon Title Size: " & Desktop.IconTitleSize
TextFile.WriteLine "Icon Title Wrap: " & Desktop.IconTitleWrap
TextFile.WriteLine "Pattern: " & Desktop.Pattern
TextFile.WriteLine "Screen Saver Active: " & Desktop.ScreenSaverActive
TextFile.WriteLine "Screen Saver Executable: " & Desktop.ScreenSaverExecutable
TextFile.WriteLine "Screen Saver Secure: " & Desktop.ScreenSaverSecure
TextFile.WriteLine "Screen Saver Timeout: " & Desktop.ScreenSaverTimeout
TextFile.WriteLine "Wall paper: " & Desktop.Wallpaper
TextFile.WriteLine "Wall paper Stretched: " & Desktop.WallpaperStretched
TextFile.WriteLine "Wall paper Tiled: " & Desktop.WallpaperTiled
TextFile.WriteLine "**********************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Desktop2.txt",1,True

Download this snippet    Add to My Saved Code

Get the desktop settings of a specific user using Win32_Desktop WMI class Comments

No comments have been posted about Get the desktop settings of a specific user using Win32_Desktop WMI class. Why not be the first to post a comment about Get the desktop settings of a specific user using Win32_Desktop WMI class.

Post your comment

Subject:
Message:
0/1000 characters