Monday, June 1, 2009

VBScript tricks : no logo, filesystem, control blocks, argument


'When running from the console, here is how to hide the logo

cscript //Nologo myscript.vbs

'How to reference an argument
WScript.Arguments.Item(0)


'Here is how to read a file

set f = fso.opentextfile(source, 1,false)



if fso.fileexists(source) then



while not f.atendofstream



inputline = f.readline



msgbox inputline

wend

end if

No comments: