Execute python command line from c# process start
NALB
71
Reputation points
hello i have a command line that output data in Json file
my command line is like below
enum –json (amass.json) –d (domainname.com)
doing it like the below code won't result in JSON format only JSON file.
// start process
using var process = Process.Start(new ProcessStartInfo
{
UseShellExecute = false
FileName = "amass",
RedirectStandardOutput = true,
ArgumentList = { "enum","-json","amass.json", "-d", "test.com" }
});
// read std out
var output = process.StandardOutput.ReadToEnd();
// wait for exit
process.WaitForExit();
// write out out
File.WriteAllText("~/FolderXTest/file.txt", output);
\
I even tried using it with bash but did not work .
I have another question , if my tool output folder not file how to implement that??
Developer technologies C#
11,567 questions
Sign in to answer