c# - Visual C # process arguments not working -
c# - Visual C # process arguments not working -
ok working other day , it's not... don't remember changing anything, can run reg.exe command arguments below cmd , works fine , creates output file. running in vc# not create file test_output.txt???
system.diagnostics.process proc_cmd = new system.diagnostics.process(); proc_cmd.startinfo.filename = @"c:\windows\system32\reg.exe"; proc_cmd.startinfo.arguments = @"query ""hklm\software\test\test software"" /v buildnumber >c:\test\test_output.txt"; proc_cmd.startinfo.createnowindow = true; proc_cmd.startinfo.redirectstandarderror = true; proc_cmd.startinfo.redirectstandardoutput = true; proc_cmd.startinfo.redirectstandardinput = true; proc_cmd.startinfo.useshellexecute = false; proc_cmd.start(); proc_cmd.close();
you should utilize registry
class instead.
c#
Comments
Post a Comment