Jump to content

Recommended Posts

Posted

Any ideas on how to achieve this?

 

Google isn't helping much, and I've not tracked down a single script that works. Is it even possible?

 

What we want to do is host the background for student desktops locally on each machine to save on network traffic, so I want to write a VBS script to copy down the correct version from the server the first time the workstation is started up after imaging, but to copy down a different version depending on screen resolution as we have a nice wallpaper designed by one of my techs that works well with BG info, but it needs to be displayed at the correct resolution to work.

 

Can anyone help!

 

Thanks in anticipation,

 

Mike.

Posted
Within BGInfo you have the option to stretch an image, so it'll cover any resolution. Double click BGInfo.exe, navigate to: Background, specify the wallpaper, then specify the Wallpaper Position as 'Stretch' from the drop down menu.
Posted

Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)

For Each objItem in colItems

intHorizontal = objItem.ScreenWidth

intVertical = objItem.ScreenHeight

Next

 

msgbox intHorizontal & " * " & intVertical

  • Thanks 2
Posted
Within BGInfo you have the option to stretch an image, so it'll cover any resolution. Double click BGInfo.exe, navigate to: Background, specify the wallpaper, then specify the Wallpaper Position as 'Stretch' from the drop down menu.

 

Yes, but that kind of messes things up when someone's made the effort to be creative and make something that will look wrong when it's stretched :-)

Posted

Thanks for that mac_shinobi

 

Just out of interest where did you find it or did you just happen to know the code? I've searched for ages and the only codes I found were for ASP web pages, or used really complex methods to grab the data.

 

And yes srochford you're right, stretching it is not an option for this background - we've got pre-defined boxes on one side of it which BG info will populate with info for us (Specifically logged on username and logon time) and these need to be the same size and in exactly the same place on each background for BGinfo to put the text in the correct place. Also stretching it just distorts it all and makes text look naff, and I want our system to be top notch in all respects.

 

Thanks all

 

Maniac.

Posted
Found it here

 

I was looking at that very site earlier, guess it depends exactly what you type in the search box as to what comes up - Nonsense in, Nonsense out. :rolleyes:

 

Mike.

Posted (edited)

It's called WMI - and I found it there and a few other places.

 

There is another way by using internet explorer to do it for you but did not have much time to do it that way so just posted the wmi way which is a lot neater and better solution

 

see below ( from one of my EE posts ) obviously this is more for setting the resolution then getting ( aside from the script below using internet explorer )

 

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_21479950.html

 

This is what I have found :

 

==================================

 

How do I change screen resolution or wallpaper?

Screen resolution cannot be changed from WSH. Here are some workarounds, almost entirely taken from Torgeir Bakken's responses on this topic.

 

Use Multires (which is free) <-- as mentioned below you can use the multires exe to apply screen resolutions etc

http://www.entechtaiwan.com/util/multires.shtm

 

Here's a reference to doing it via Java

http://home.istar.ca/~neutron/JDirect/DisplaySettings/

 

It should also be possible to do this using the ChangeDisplaySettings API, but you would need to write a component to access it.

 

Win9x clients running the QuickRes powertoy can run a shell command like this:

RunDLL deskcp16.dll,QUICKRES_RUNDLLENTRY 1280x1024x24

 

FINDING the screen resolution is possible, albeit not "natively" - here's a quick script that will give you current screen resolution via Internet Explorer:

 


with createobject("internetexplorer.application")
   .navigate "about:blank"
   with .document.parentWindow.screen
     msgbox .width & " by " & .height
   end with
 end with

Wallpaper can be modified in the registry; unfortunately, changes don't take place until you refresh, either by logoff/logon or by manually refreshing the desktop.

The relevant registry key is HKCU\Control Panel\Desktop\Wallpaper. To see an example script of copying wallpaper and changing it, see:

 

http://groups.google.com/groups?selm=uFMs1Zq1AHA.2092%40tkmsftngp05

 

There is a rundll32 command to update the HKCU section of the registry as well which will update it without logging off and back on

 

===================================

 

I got that from this site :

 

http://www.mvps.org/scripting/faq/wshfaq.htm

Edited by mac_shinobi
Posted

if you just want to set it and forget it i use a script on the pcs ou that on bootup copy's a batch file to c:\documents and settings\all users\start menu\programs\startup

 

use qures.exe (i copy to c:\windows so its pathed) then batch file in all user\startup is

 

qres /x:1440 /y:900 /c:16

 

just change the numbers as appropriate (i use 16 as some sherston software cant hack 32 bit colour)

Posted
if you just want to set it and forget it i use a script on the pcs ou that on bootup copy's a batch file to c:\documents and settings\all users\start menu\programs\startup

 

use qures.exe (i copy to c:\windows so its pathed) then batch file in all user\startup is

 

qres /x:1440 /y:900 /c:16

just change the numbers as appropriate (i use 16 as some sherston software cant hack 32 bit colour)

 

you can do that with multi res as well and for multiple monitors

Posted
Yes, but that kind of messes things up when someone's made the effort to be creative and make something that will look wrong when it's stretched :-)

I wish someone (else, my comments go in one ear and out the other) would tell that to one of the IT staff here. He hasn't updated his video driver. I know I'm a pedant, but I just can't stand seeing things displayed in 4:3 on a widescreen monitor. The entire thing is stretched horizontally. :frusty:

Posted
I wish someone (else, my comments go in one ear and out the other) would tell that to one of the IT staff here. He hasn't updated his video driver. I know I'm a pedant, but I just can't stand seeing things displayed in 4:3 on a widescreen monitor. The entire thing is stretched horizontally. :frusty:

 

One thing that annoys me as well that it, TFT screens being set to anything except their native resolution always looks rubbish.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...