Page 1 of 1 1
Topic Options
#75050 - 2003-05-17 03:12 AM Help Converting a VBS script to KIX
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Does anyone know how to convert this .VBS script to KiX?

I can't seem to get the UseAmendedQualifiers portion of the script to work correctly in KiX.

http://msdn.microsoft.com/library /default.asp?url=/library/en-us/cpref/html/frlrfsystemmanagementputoptionsclassuseamendedqualifierstopic.asp


' SetEventLogValues.vbs

Const wbemFlagUseAmendedQualifiers = &h20000
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate,(Security)}!\\" & _
strComputer & "\root\cimv2")
Set colNTEventLogFiles = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTEventLogFile")
For each objNTEventLogFile in colNTEventLogFiles
objNTEventLogFile.MaxFileSize = 16750000
objNTEventLogFile.OverwriteOutDated = 0
objNTEventLogFile.Put_ wbemFlagUseAmendedQualifiers
Next


[ 17. May 2003, 03:24: Message edited by: NTDOC ]

Top
#75051 - 2003-05-17 03:59 AM Re: Help Converting a VBS script to KIX
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Shawn and I worked on this code a long time ago and could not get it to work on 2000. It would only work on XP.

Well, Shawn got it to work with 2000/XP now.


$wbemFlagUseAmendedQualifiers = &020000
$strComputer = "."

$objWMIService = GetObject("winmgmts:" +
"{impersonationLevel=impersonate,(Security)}!\\" +
$strComputer + "\root\cimv2")
$colNTEventLogFiles = $objWMIService.ExecQuery
("SELECT * FROM Win32_NTEventLogFile")

For each $objNTEventLogFile in $colNTEventLogFiles
$objNTEventLogFile.MaxFileSize = 16750000
$objNTEventLogFile.OverwriteOutDated = 0
$= $objNTEventLogFile.Put_($wbemFlagUseAmendedQualifiers)
Next

Top
#75052 - 2003-05-17 04:59 AM Re: Help Converting a VBS script to KIX
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I remember Lonk built a converter for VBS2Kix somewhere..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75053 - 2003-05-17 03:22 PM Re: Help Converting a VBS script to KIX
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm not actually sure doc what was so hard in this one...
pretty straight forward...
_________________________
!

download KiXnet

Top
#75054 - 2003-05-18 05:31 AM Re: Help Converting a VBS script to KIX
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
This particular string would not work on 2000 for some reason. Shawn and I both tried multiple variations of code to make it work. It would work on XP but not on 2000. I don't have the original code snipets from before so I'm not sure if we changed something around this time that we didn't do last time, or if 2000 has some IE update that it did not have in the past that now makes it work.

$objNTEventLogFile.Put_($wbemFlagUseAmendedQualifiers)

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 84 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.051 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org