We have a company application for automating certain tasks (it doesn’t matter what actually). In our software we have the abbility to build a script based on our own commands, were also able to run a VBScript script within the same environment. We have a function built into the software, so we can get and set variables from a VBScript script within our own script.
In our manual we have this description: “The VB script feature provides a new VB object “AppName”. One of the functions are: AppName.GetStringVariable(“variable”). So by just using it like this in a VBScript script it’s possible to set or get this variable. You would write it like this inside the VBScript script:
stringInput = AppName.GetStringVariable("variable")
The VBscript engine is running in a different process than the C#.NET application. So this VBscript object is running in a different process, which I would like to access in my C#.NET application.
Are there any possibility to get this variable within a C# .NET environment?
I have tried:
System.Environment.GetEnvironmentVariable("AppName.GetStringVariable(string1)");
System.Environment.GetEnvironmentVariable("AppName.GetStringVariable('string1')");
System.Environment.GetEnvironmentVariable("AppName.GetStringVariable(\"string1\")");
In the vbScript monitor a file that is updated by c# and set the property:
Then from c# setup a FileSystemWatcher to another file (use json, it’s easy to deserialize) and get the vbScript set property.