Process.Start filename using %temp%

后端 未结 5 1900
孤街浪徒
孤街浪徒 2021-01-20 04:48

For some odd reaseon this code fails:

p.StartInfo.FileName = @\"%temp%\\SSCERuntime_x86-ENU.msi\";

and this code succes:

p.         


        
5条回答
  •  抹茶落季
    2021-01-20 05:34

    %TEMP% is parsed and evaluated by Command Shell. You could use use Path.GetTempPath() and Path.Combine for this purpose.

    p.StartInfo.FileName = Path.Combine(Path.GetTempPath(), @"SSCERuntime_x86-ENU.msi");
    

提交回复
热议问题