Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 18th, 2008, 5:41 PM   #1
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Detect number of monitors

I was wondering if anyone has an idea on how to detect the number of monitors that are attached to a remote system.
PhilBon is offline   Reply With Quote
Old Jan 18th, 2008, 7:34 PM   #2
ZenMasterJG
Hobbyist Programmer
 
ZenMasterJG's Avatar
 
Join Date: Nov 2004
Location: Boston, MA
Posts: 148
Rep Power: 4 ZenMasterJG is on a distinguished road
Send a message via AIM to ZenMasterJG
Re: Detect number of monitors

Operating system? Programming language? Any details at all?
ZenMasterJG is offline   Reply With Quote
Old Jan 18th, 2008, 8:01 PM   #3
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Re: Detect number of monitors

I'm sorry. It's windows XP and the programming language will be vb.net/vbscript unless there is an easier way in another language.
PhilBon is offline   Reply With Quote
Old Jan 19th, 2008, 12:27 AM   #4
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 272
Rep Power: 2 Jabo is on a distinguished road
Re: Detect number of monitors

vb 2005 xpress
vb Syntax (Toggle Plain Text)
  1. My.Computer.Screen.AllScreens
Jabo is offline   Reply With Quote
Old Jan 19th, 2008, 4:35 AM   #5
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Re: Detect number of monitors

Is there a way to do that to a remote computer. I'd have administrative rights on the remote and local computer.
PhilBon is offline   Reply With Quote
Old Jan 19th, 2008, 3:13 PM   #6
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Detect number of monitors

PsExec from Microsoft (prev. Sysinternals) is great for that sort of thing. It will copy over your script/program to the remote machine, run it, and redirect the standard input/output streams back to you. It's a terrible hack to get some of the functionality so common on just about every other OS.

This may be easier with WMI. I'm looking in to that right now.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270

Last edited by Dameon; Jan 19th, 2008 at 3:29 PM.
Dameon is offline   Reply With Quote
Old Jan 19th, 2008, 3:30 PM   #7
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 547
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: Detect number of monitors

Quote:
Originally Posted by PsExec
Note: some anti-virus scanners report that one or more of the tools are infected with a "remote admin" virus. None of the PsTools contain viruses, but they have been used by viruses, which is why they trigger virus notifications.
Just as I thought. I wouldn't trust anyone using that program on my computer without my knowledge. PsExec = Evil
Ancient Dragon is offline   Reply With Quote
Old Jan 19th, 2008, 3:47 PM   #8
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Detect number of monitors

Quote:
Originally Posted by Ancient Dragon View Post
Just as I thought. I wouldn't trust anyone using that program on my computer without my knowledge. PsExec = Evil
If 'they' without your knowledge have access to the admin$ share and can remotely start services, you're already in trouble. PsExec is just convenience. Domain admins and such should have those privileges.

Anyway, WMI may do the trick for you.

Take a look at http://technet.microsoft.com/en-us/l.../bb742610.aspx

wmic /user:"MACHINE\User" /node:MACHINE desktopmonitor where availability!=8 get description, screenwidth, screenheight

I used that on my home network to get info about the monitors seemingly plugged in (availability not offline) on a remote machine. The user switch would be unnecessary in a domain environment. It looks like you should be able to specify multiple machines and specify a choose a convenient output format such as HTML or CSV. Should do the trick.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jan 19th, 2008, 4:44 PM   #9
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Re: Detect number of monitors

@dameon: Is there any way to just return the count of how many?
@Ancient Dragon: If you are a user in a network with a computer. There are far more ways than just pxexec for Admins to run on your computer and chances are if they are running it on your computer it's for a specific reason and not someone trying to screw it up.
PhilBon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Guess a Number 3n! C++ 7 Dec 2nd, 2007 3:38 AM
c-unix-childprocesses-random number programmingnoob C 7 Feb 6th, 2007 8:39 PM
find max number in an array paulmedic555 C 4 Nov 20th, 2006 10:01 AM
non repeating random number generation gencor45 C# 2 Feb 9th, 2005 12:11 AM
Number Systems... Ade Coder's Corner Lounge 7 Jan 19th, 2005 5:32 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC