number CreateTestVBS( string VBScriptFile ) { DocumentWindow VBScript = NewScriptWindow( "VB Script", 100, 100, 700, 1000 ) VBScript.EditorWindowAddText( "Dim ArgObj, var1, var2" + "\n" ) VBScript.EditorWindowAddText( "Set ArgObj = WScript.Arguments" + "\n" ) VBScript.EditorWindowAddText( "Set WshShell = WScript.CreateObject(\"WScript.Shell\")" + "\n" ) VBScript.EditorWindowAddText( "var1 = ArgObj(0)" + "\n" ) VBScript.EditorWindowAddText( "var2 = ArgObj(1)" + "\n" ) VBScript.EditorWindowAddText( "msgbox \"Hello World\" & vbCrLf & var1 & vbCrLf & var2" + "\n" ) If ( !OKCancelDialog( "Saving and Closing this VisualBasic script now." ) ) return 0 number fileID = CreateFileForWriting( VBScriptFile ) WriteFile( fileID, VBScript.EditorWindowGetText() ) CloseFile( fileID ) VBScript.WindowClose(0) return 1 } // Step 1: Create (or have) a VB script as file on disc string VBscriptFile = "C:\\TestScript.vbs" if ( !CreateTestVBS( VBscriptFile ) ) exit(0) // Step 2: Running a VB script from disc // We build the command as... string commandStr // ...silently launch from the command prompt commandStr += "cmd.exe /c " // ...use the command to call a VB Script from the command promput commandStr += "cscript //nologo " // ..that is the file-path to the VB Script commandStr += VBscriptFile // .. This particulra VB script requires two command-line parameters commandStr += " \"Line1\" \"Line2\"" // Show and then perform the call OKDialog( "Calling command:\n" + commandStr ) LaunchExternalProcess( commandStr )