c# - How to execute a shell command in the current cmd.exe context? -
so, have .net utility. need use utility(ilasm , ildasm) sometimes in path variable , not. specific times when it's in path includes when using visual studio command line script.. , when it's not when launch regular cmd.exe
instance.
all of information i've seen executing shell command .net imply can create new instance of cmd.exe, in case, path variable different. other possible thing manually parsing path variable , execute directly processstartinfo
when found, seems error prone , unnecessary
is there tool or me situation? how should go executing these utilities?
when start cmd.exe, can set environment path:
var psi = new processstartinfo("cmd.exe"); psi.useshellexecute = false; psi.environmentvariables["path"] = "mypath"; process.start(psi);
please prefer comment before downvote.
Comments
Post a Comment