Solved

Windows Scripting, determing the screen area settings with vbscript.

Posted on 2004-08-19
4
127 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
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 125 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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…
Google always has something new and amazing up its sleeve, and the most current thing that they have been working on is another step in the evolution of Google Search, from machine learning to its brilliant successor, deep learning.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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