Visual Basic scripting dynamic array

You can’t re-dimension a fixed-size array (Dim vprglist(10)). If you want a dynamic array, define a “normal” variable and assign an empty array to it: Dim vprglist : vprglist = Array() or define it directly with ReDim: ReDim vprglist(-1) Then you can re-dimension the array like this: If vprogram.LastRunTime = “” Then ReDim Preserve vprglist(UBound(vprglist)+1) … Read more

Creating a script for a Telnet session?

I’ve used various methods for scripting telnet sessions under Unix, but the simplest one is probably a sequence of echo and sleep commands, with their output piped into telnet. Piping the output into another command is also a possibility. Silly example (echo password; echo “show ip route”; sleep 1; echo “quit” ) | telnet myrouter … Read more

How to compile a linux shell script to be a standalone executable *binary* (i.e. not just e.g. chmod 755)?

The solution that fully meets my needs would be SHC – a free tool, or CCsh a commercial tool. Both compile shell scripts to C, which then can be compiled using a C compiler. Links about SHC: Links about CCsh:

VBScript getting results from Shell

You will want to use the WshShell object’s Exec method instead of Run. Then simply read the command line’s output from the standard streams. Try this one: Const WshFinished = 1 Const WshFailed = 2 strCommand = “ping.exe” Set WshShell = CreateObject(“WScript.Shell”) Set WshShellExec = WshShell.Exec(strCommand) Select Case WshShellExec.Status Case WshFinished strOutput = WshShellExec.StdOut.ReadAll … Read more