Home All Groups Group Topic Archive Search About


Author
16 Mar 2007 11:33 AM
Miztiik
i have this script from scriptomatic

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("localhost")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_DisplayConfiguration", "WQL", _
                                          wbemFlagReturnImmediately +
wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "BitsPerPel: " & objItem.BitsPerPel
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "DeviceName: " & objItem.DeviceName
      WScript.Echo "DisplayFlags: " & objItem.DisplayFlags
      WScript.Echo "DisplayFrequency: " & objItem.DisplayFrequency
      WScript.Echo "DitherType: " & objItem.DitherType
      WScript.Echo "DriverVersion: " & objItem.DriverVersion
      WScript.Echo "ICMIntent: " & objItem.ICMIntent
      WScript.Echo "ICMMethod: " & objItem.ICMMethod
      WScript.Echo "LogPixels: " & objItem.LogPixels
      WScript.Echo "PelsHeight: " & objItem.PelsHeight
      WScript.Echo "PelsWidth: " & objItem.PelsWidth
      WScript.Echo "SettingID: " & objItem.SettingID
      WScript.Echo "SpecificationVersion: " & objItem.SpecificationVersion
      WScript.Echo
   Next
Next

i want this to be able to run from a html file and output it to an textfile

Author
16 Mar 2007 7:03 PM
Steven
You will need to use a filesystemobject (FSO) to open/create the text file
(may be different if using jscript instead of vbscript).  There are many
examples in the MS script repository that cover this.

You can embed the script inside an HTA (HTML Application) file.  You will
need to research this as it is a bit much to post here (check out the MS
scripting repository for examples/tutorials and use google to find more
examples/information).  Scriptomatic is an HTA by the way.

First make the final script work from the command line (including output to
a text file) so you can see any errors more easily, then copy the working
script into your HTA script section and modify any Wscript.echo and other
unsupported lines accordingly.  If your outputting to a file using an FSO
you should get the result your looking for.

I'm sure there are other ways to do this as hell other than an HTA (Frankly,
I'd like to know as well).


Show quote
"Miztiik" <Mizt***@discussions.microsoft.com> wrote in message
news:E7F1BD63-7DDE-4392-A7FE-089BF8DF0856@microsoft.com...
>i have this script from scriptomatic
>
> On Error Resume Next
>
> Const wbemFlagReturnImmediately = &h10
> Const wbemFlagForwardOnly = &h20
>
> arrComputers = Array("localhost")
> For Each strComputer In arrComputers
>   WScript.Echo
>   WScript.Echo "=========================================="
>   WScript.Echo "Computer: " & strComputer
>   WScript.Echo "=========================================="
>
>   Set objWMIService = GetObject("winmgmts:\\" & strComputer &
> "\root\CIMV2")
>   Set colItems = objWMIService.ExecQuery("SELECT * FROM
> Win32_DisplayConfiguration", "WQL", _
>                                          wbemFlagReturnImmediately +
> wbemFlagForwardOnly)
>
>   For Each objItem In colItems
>      WScript.Echo "BitsPerPel: " & objItem.BitsPerPel
>      WScript.Echo "Caption: " & objItem.Caption
>      WScript.Echo "Description: " & objItem.Description
>      WScript.Echo "DeviceName: " & objItem.DeviceName
>      WScript.Echo "DisplayFlags: " & objItem.DisplayFlags
>      WScript.Echo "DisplayFrequency: " & objItem.DisplayFrequency
>      WScript.Echo "DitherType: " & objItem.DitherType
>      WScript.Echo "DriverVersion: " & objItem.DriverVersion
>      WScript.Echo "ICMIntent: " & objItem.ICMIntent
>      WScript.Echo "ICMMethod: " & objItem.ICMMethod
>      WScript.Echo "LogPixels: " & objItem.LogPixels
>      WScript.Echo "PelsHeight: " & objItem.PelsHeight
>      WScript.Echo "PelsWidth: " & objItem.PelsWidth
>      WScript.Echo "SettingID: " & objItem.SettingID
>      WScript.Echo "SpecificationVersion: " & objItem.SpecificationVersion
>      WScript.Echo
>   Next
> Next
>
> i want this to be able to run from a html file and output it to an
> textfile
>
>

AddThis Social Bookmark Button