By Chris Graham
PROBLEM: We have a NAL application that we only want to be available if the screen resolution is 1024×768 or higher. We have had no luck finding anything in the registry, in a readable format, to determine the screen size.
Create a forced-run, install-only NAL app. Place the code in the Run Options|Launch Scripts|Run before Launching box. Set the Script Engine Location to wscript.exe and the file extension to .vbs
The code will determine the screen resolution, create an environment variable (ScrRes) with the value of the width of the screen and refresh NAL.
We then use the ScrRes variable to determine the availability of our other application.
set oShell = wscript.createobject("wscript.shell") set sysenv = oshell.environment("Volatile") '*** Get width value of screen resolution with createobject("internetexplorer.application") .navigate "about:blank" '*** Set the ScrRes environment variable to equal the screen width with .document.parentWindow.screen sysenv("ScrRes") = .width end with end with '*** Wait 5 seconds and refresh NAL wscript.sleep 5000 oShell.run "Z:\mgmt\ConsoleOne\1.2\lib\zen\autorun.exe"
If you have any questions you may contact Chris at grahamcTAKETHISOUT@tbh.net