Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[color blue]SET SAFETY OFF
SET DELETED ON
lcFile = [wmiscript.txt]
STRTOFILE(_CLIPTEXT,lcFile)
CREATE CURSOR csrCONVERT (ctext C(254))
APPEND FROM (lcFile) SDF
REPLACE csrCONVERT.ctext WITH STRTRAN(csrCONVERT.ctext,[Set ],[]) ;
FOR [GetObject(] $ csrCONVERT.ctext
REPLACE csrCONVERT.ctext WITH STRTRAN(csrCONVERT.ctext,[Set ],[]) ;
FOR [colItems] $ csrCONVERT.ctext
REPLACE csrCONVERT.ctext WITH STRTRAN(csrCONVERT.ctext,[ _],[ ;]) ;
ALL
REPLACE csrCONVERT.ctext WITH STRTRAN(csrCONVERT.ctext,[& ],[<<]) ;
FOR [Wscript.Echo ] $ csrCONVERT.ctext ALL
REPLACE csrCONVERT.ctext WITH SPACE(5) ;
+ ALLTRIM(csrCONVERT.ctext) + [>>] ;
FOR [Wscript.Echo ] $ csrCONVERT.ctext ;
AND [objItem] $ csrCONVERT.ctext ALL
REPLACE csrCONVERT.ctext WITH CHRTRAN(csrCONVERT.ctext,["],[]) ;
FOR [Wscript.Echo ] $ csrCONVERT.ctext ALL
REPLACE csrCONVERT.ctext WITH STRTRAN(csrCONVERT.ctext,[Wscript.Echo ],[\]) ALL
REPLACE csrCONVERT.ctext WITH CHRTRAN(csrCONVERT.ctext,[&],[+]) ALL
DELETE FOR LEFT(ALLTRIM(csrCONVERT.ctext),2) = [If] ALL
DELETE FOR LEFT(ALLTRIM(csrCONVERT.ctext),4) = [Else] ALL
DELETE FOR [Join(] $ ALLTRIM(csrCONVERT.ctext) ALL
DELETE FOR LEFT(ALLTRIM(csrCONVERT.ctext),3) = [End] ALL
LOCATE FOR [For Each] $ csrCONVERT.ctext
INSERT BLANK BEFORE
REPLACE csrCONVERT.ctext WITH [\\WMI class data report on <<DATE()>> at <<TIME()>>]
INSERT BLANK BEFORE
REPLACE csrCONVERT.ctext WITH [SET TEXTMERGE ON TO test.txt NOSHOW]
GO BOTTOM
INSERT INTO csrCONVERT VALUES ([SET TEXTMERGE OFF])
INSERT INTO csrCONVERT VALUES ([SET TEXTMERGE TO])
lcProgram = []
SCAN
lcProgram = lcProgram ;
+ RTRIM(csrCONVERT.ctext) ;
+ CHR(13)
ENDSCAN
TRY
EXECSCRIPT(lcProgram)
lcString = FILETOSTR([test.txt])
lcString = STRTRAN(lcString,[.NULL.],[])
lcString = STRTRAN(lcString,[.T.],[Yes])
lcString = STRTRAN(lcString,[.F.],[No])
lnOccurs = OCCURS(REPLICATE([-],35),lcString) / 2
lcString = lcString ;
+ CHR(13) ;
+ CHR(13) ;
+ TRANSFORM(lnOccurs) ;
+ [ instances found]
STRTOFILE(lcString,[test.txt])
MODIFY FILE test.txt
CATCH
MESSAGEBOX([There is a error with the script])
STRTOFILE(lcProgram,[test.txt])
MODIFY FILE test.txt
ENDTRY[/color]