Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

script to capture user screen res and printers

Posted on 2012-03-23
6
Medium Priority
?
496 Views
Last Modified: 2012-05-23
Hi,

Does anyone know if it is possible to script what a users screen resolution is and what printers they have installed and output that information to a text file?

The reason behind it is new user profiles and I want to capture this information, I have scripted other things but just need help with this part if it is possible in anyway?

doesnt have to be a text file it outputs to, can be any other file or automated method!

many thanks
0
Comment
Question by:speechlys
  • 4
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37759581
You can do this with WMI, via a command line or a script, command line would be:
(open cmd prompt)
wmic path Win32_DisplayConfiguration get PelsHeight,PelsWidth

You have to be administrator to get it from a remote machine like:
wmic /node:pc_name.example.com path Win32_DisplayConfiguration get PelsHeight,PelsWidth
(replace pc_name... with the pc's name, or IP address)

Here is a similar script you can have in the user's "startup" folder
http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/21/how-can-i-determine-the-current-screen-resolution-being-used-on-a-computer.aspx
-rich
0
 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37759601
Redirect the output to a file like this
wmic path Win32_DisplayConfiguration get PelsHeight,PelsWidth >C:\temp\resolution.txt
or any path you choose. Same with the VBS script from the link...
cscript resolution.vbs >c:\temp\resolution.txt
-rich
0
 

Author Comment

by:speechlys
ID: 37777635
ok thanks, what about printers ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37777782
wmic printer get HorizontalResolution,VerticalResolution,name
That will give you the printers resolution. Just run both commands from a .bat file (batch file) one on one line the second on the next line.
-rich
0
 

Author Comment

by:speechlys
ID: 37777812
i want the installed printers of the user to output to a text file or any other format! this will do that?
0
 
LVL 38

Accepted Solution

by:
Rich Rumble earned 2000 total points
ID: 37778081
Did you try the command? It outputs the following:
C:\Windows\system32>wmic printer get name,drivername,Description,HorizontalResolution,VerticalResolution
Description  DriverName                     HorizontalResolution  Name                           VerticalResolution
             Microsoft XPS Document Writer  600                   Microsoft XPS Document Writer  600
             HP Officejet 6300 series       600                   HP Officejet 6300 series       600
             Microsoft Shared Fax Driver    200                   Fax                            200

Open in new window


C:\Windows\system32>wmic printer where "default='TRUE'" get name
Name
HP Officejet 6300 series

You can do "wmic printer get /?" on a command prompt to find all the available items.
You could also download the Scriptomatic 2.0 from M$ and start playing with that, it creates all the code you'd need for the most part.
-rich
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question