Does anybody know if there is a .NET assembly equivalent to the 'Windows Script Host Object Model'.WshShell. component?
I'd appreciate any suggestion. Thanks.
Name DataType Subtype Length
WShell DotNet System.Diagnostics.Process.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
ProcInfo DotNet System.Diagnostics.ProcessStartInfo.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
StreamReader DotNet System.IO.StreamReader.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
TextReader DotNet System.IO.TextReader.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Lin Text
And this is the code to the equivalent Shell in .NET:
dotNetShell(Program2Call : Text[1024];Parameters : Text[1024];Mode : 'Silence,Text,Stream')
ProcInfo := ProcInfo.ProcessStartInfo;
ProcInfo.FileName := Program2Call;
ProcInfo.Arguments := Parameters;
ProcInfo.UseShellExecute := FALSE;
ProcInfo.RedirectStandardOutput := TRUE;
ProcInfo.WindowStyle := 1; // Hidden,
ProcInfo.CreateNoWindow := TRUE;
WShell:= WShell.Start(ProcInfo);
IF Mode <> Mode::Silence THEN BEGIN
IF (Mode = Mode::Texto) THEN BEGIN
TextReader := WShell.StandardOutput;
Lin := TextReader.ReadToEnd;
MESSAGE(Lin);
END ELSE BEGIN
StreamReader := WShell.StandardOutput;
WHILE NOT StreamReader.EndOfStream DO BEGIN
Lin := StreamReader.ReadLine;
MESSAGE(Lin);
END;
END;
END;
WShell.WaitForExit;
Answers
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Here are the variables:
And this is the code to the equivalent Shell in .NET:
Regards
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/