I am trying to run a JavaScript code that should return a string like 'GEORGE SMITH'. However, when I attempt to execute the code, I receive an error message stating: " The specified executable is not a valid Win32 application"
Is there a way for me to capture this information successfully? I have attempted to call the JavaScript from a .bat file but have been unsuccessful in retrieving the output. Can anyone provide guidance on how to resolve this issue?
Below is the snippet of code I am using:
{
Process proc = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "cardholder.js";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo = startInfo;
proc.Start();
nombreApellido = proc.StandardOutput.ReadToEnd();
proc.Close();
proc.Dispose();
}