Trigger an exe or vbs with parameters from VTW

Novacane89

Member
Hi fellow viz enthusiasts,

Can someone enlighten me on how I can trigger my exe scripts from VTW ? Also specifically a exe or vbs script with 2 parameters. Below I tried to run the script with the supplied 2 parameters. input and output and then trigger it using Wcript but am getting a strange error response from the script doc. I get the colon ":" in 2 lines below one another as an error message :-? And no actual useful error info.

When I remove the exe reference with the parameters it opens a windows directory fine. but when I point the script to an exe or exe with params it gives me ":\n:" in the error field and does not trigger the script.

I have tried this
"
set Shell = CreateObject("Wscript.Shell")
cmd = "K:\Apps\TextSanitizer\TextSanitizer.exe" & " " & "K:\SportsData\Tennis\AusOpen.txt" & " " & "C:\test\AusOpenSanitized.txt"
Shell.Run cmd,0,1
"
Best Regards
 
Hi fellow viz enthusiasts,

Can someone enlighten me on how I can trigger my exe scripts from VTW ? Also specifically a exe or vbs script with 2 parameters. Below I tried to run the script with the supplied 2 parameters. input and output and then trigger it using Wcript but am getting a strange error response from the script doc. I get the colon ":" in 2 lines below one another as an error message :-? And no actual useful error info.

When I remove the exe reference with the parameters it opens a windows directory fine. but when I point the script to an exe or exe with params it gives me ":\n:" in the error field and does not trigger the script.

I have tried this
"
set Shell = CreateObject("Wscript.Shell")
cmd = "K:\Apps\TextSanitizer\TextSanitizer.exe" & " " & "K:\SportsData\Tennis\AusOpen.txt" & " " & "C:\test\AusOpenSanitized.txt"
Shell.Run cmd,0,1
"
Best Regards

Hi, try using this code
Code:
Set objShell = CreateObject( "WScript.Shell" )
arg1 = "K:\SportsData\Tennis\AusOpen.txt"
arg2 = "C:\test\AusOpenSanitized.txt"
cmd = """K:\Apps\TextSanitizer\TextSanitizer.exe"" " & arg1 & " " & arg2 & ""
objShell.Run cmd, 0, 1
Set objShell = Nothing

J.
 
Hi Jozef,

Thanks for the assistance, With this code it does not give an error anymore :). But it also does not trigger the exe. I will do some more tests tomorrow and try vbs files.

Cheers, Appreciated
 
Hi Jozef,

Thanks for the assistance, With this code it does not give an error anymore :). But it also does not trigger the exe. I will do some more tests tomorrow and try vbs files.

Cheers, Appreciated


Link: Example Video

C#:
using System;

namespace TextSanitizer
{
    internal class Program
    {
        static void Main(string[] args)
        {
            foreach (string arg in args)
            {
                Console.WriteLine(arg);
            }
            Console.ReadLine();
        }
    }
}
 
Very interesting. What VCP/VTW version are you using?
Link: ExampleClip
As seen in my clip I have all setup according but no dice. Maybe its a VCP 7 thing. atleast we are upgrading soon.
Appreciate the help.
 
Very interesting. What VCP/VTW version are you using?
Link: ExampleClip
As seen in my clip I have all setup according but no dice. Maybe its a VCP 7 thing. atleast we are upgrading soon.
Appreciate the help.

VTW is version 8.9.0, but it will definitely not be a problem to see the window opening - you need to change the parameter from 0-1, in the video you have 0 = hide the running window

objShell.Run cmd, 1, 1
 
Hi Jozef,

Thanks so much. That sorted the issue, And nice to know I can run it in hidden mode.
Much appreciated🙏.

Best Regards
 
Back
Top