Tuesday, January 08, 2013

Clustering a VB script

I was in the need to test some clustering items, but did not need a specific application to be installed.  So I had the following VB script to do nothing more than keep writing the current date and time every 30 seconds.

'//initialize script components
                On Error Resume Next
                'Option Explicit
                Dim objShell
                Dim strOutputFile
'//initialize WMI objects
                Set objShell =                    WScript.CreateObject("WScript.Shell")
'//initialize variables
                strOutputFile = "C:\temp\super_awesome_log_file_for_keith.log"
                tfDoWhileLoopExit = "false"
                Do While tfDoWhileLoopExit = "false"
                                'wscript.echo "boo"
                                objShell.Run("cmd /c ECHO " & Now & chr(62) & chr(62) & " " & strOutputFile)
                                wscript.sleep 30000
                Set objShell = Nothing
                strOutputFile = ""
                tfDoWhileLoopExit = ""

So I created a Generic Application with the follow settings:

No comments: