Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows Scripting, determing the screen area settings with vbscript.

Posted on 2004-08-19
4
Medium Priority
?
140 Views
Last Modified: 2010-04-13
How do I determine the screen area settings using vbscript. I want copy a shortcut from a central location based on the screen area.
0
Comment
Question by:mdavisba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 500 total points
ID: 11841379
Hi

to get the screen width and height you could use

Set oWMIService = GetObject( "winmgmts://./root/cimv2" )
Set oItems = oWMIService.ExecQuery( "Select * from Win32_DisplayConfiguration", , 48 )

  ' Get width and height
  For Each oItem in oItems
      str_Width = oItem.PelsWidth
      str_Height = oItem.PelsHeight
  Next

  ' Display width and height
  Msgbox "Width: " & str_Width & " height: " & str_Height

' Tidyup
Set oItems = Nothing
Set oWMIService = Nothing

HTH

Regards

Scott
0
 

Author Comment

by:mdavisba
ID: 11842374
Thanks Scott,

I worked out a less reliable method, this way works a lot faster.

I am trying copy a shortcut to the desktop, however, the script does not have enough permissions. Any Ideas?
0
 
LVL 15

Expert Comment

by:Colosseo
ID: 11910256
Hi Mdavisba

Sorry its been a while I must have missed you comment.

Are you still having problems creating the shortcut?

Cheers

Scott
0
 

Author Comment

by:mdavisba
ID: 11910809
In the end I did not need to create the shortcut, all I needed to do is the script to determine the screen size and then run an application with appropriate switches.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

618 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