Showing posts with label windows programming vbs. Show all posts
Showing posts with label windows programming vbs. Show all posts

Thursday, December 2, 2010

Capture standard output (stdout) in console command running at VBS

We can use WScript.Shell.Exec( ) and WScript.Shell.StdOut.ReadLine( ) to perform the task:




Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd /c dir")
strText=""
Do While Not objExecObject.StdOut.AtEndOfStream
strText = strText & objExecObject.StdOut.ReadLine() & chr(13)
Loop
Wscript.Echo strText

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...