I have a .vbs script file that needs to be executed from a C# application. We would normally execute the vbs file from right-clicking it and selecting "Open With Command Prompt" so the user can input arguments and the script will take off.
With the code below I'm able to execute the vbs file but it still prompts for input:
var MyProcess = new Process();
MyProcess.StartInfo.FileName = @"MyVBSScript.vbs";
MyProcess.StartInfo.WorkingDirectory = @"C:\Folder\WhereVBS\FileLives";
MyProcess.StartInfo.Arguments = @"UserArgumentWithoutSpaces";
MyProcess.Start();
MyProcess.WaitForExit();
MyProcess.Close();
My goal is to bypass the prompt by passing an argument. Is there something I need to do in the VBS file or does something in my C# code need to change?