All templates
ScriptingIntermediate
Display VBScript Output
Robomotion•Updated 6 months ago

Overview
Executes a VBScript snippet and displays its output. Useful when integrating with legacy Windows tooling.
Display VBScript Output
Microsoft VBScript is a general-purpose, active scripting language designed for various environments. Robomotion users can run VBScript scripts through their flows and unlock unlimited automation capabilities.
What Display VBScript Output can do
- Build script (
Core.Programming.Function) — stores the inline VBScript body inmsg.vbs_script, builds a temp pathmsg.vbs_pathunder$TempDir$(fallbackC:\Windows\Temp), and preparesmsg.vbs_args = ['//Nologo', msg.vbs_path]. - Write temp VBS (
Core.FileSystem.WriteFile,optMode: truncate) — writesmsg.vbs_scripttomsg.vbs_path. - Run VBScript (
Core.Process.StartProcess) — runscscriptwithmsg.vbs_args, captures stdout intomsg.vbscript_output. - Delete temp VBS (
Core.FileSystem.Delete,continueOnError: true) — cleans up the temp.vbsfile. - Trim output (
Core.Programming.Function) — strips trailing CR/LF frommsg.vbscript_output. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledOutput from VBScript:showsmsg.vbscript_output, thenCore.Flow.Stop.
Behind the scenes
WScript.Echowrites to stdout undercscript.exe; underwscript.exeit would pop a modal. The flow usescscriptso the value arrives via stdout and can be captured.- The temp file name includes
Date.now()to avoid collisions across concurrent runs; deletion is best-effort (continueOnError). - VBScript is deprecated in Windows 11 24H2 — for new work prefer PowerShell.