[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Windows Scripting, determing the screen area settings with vbscript.

Posted on 2004-08-19
4
Medium Priority
?
145 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

872 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