【问题标题】:c# open folder in C:\Windows\system32 via total-commanderc#通过total-commander打开C:\Windows\system32中的文件夹
【发布时间】:2013-11-03 01:13:05
【问题描述】:

我在使用 Total-commander 打开 Windows 系统文件夹时遇到了一点问题 当我在 cmd 中手动运行命令时,它可以,但是当它作为 ProcessStartInfo 运行时不是。 此问题发生在 Windows XP 上,Windows 7 参数(路径)有点不同但可以正常工作。

            ProcessStartInfo startInfo = new ProcessStartInfo(); //New Proccess
            startInfo.Arguments = "/L=" + GetArgument(); //Return C:\WINDOWS\system32\config\systemprofile\Local Settings\Application ata\MyApp\update\download [it´s OK]
            startInfo.WorkingDirectory = Path.GetDirectoryName(GetTcmdPath());
            startInfo.FileName = GetTcmdPath(); //returns C:\Program Files\totalcmd\TOTALCMD.EXE [it´s OK]
            Process.Start(startInfo); //Start proccess 

TC 已启动,但路径为:C:\WINDOWS\system32\config\systemprofile 并且不知道为什么 有人可以帮帮我吗?

编辑:当我在没有" 的 cmd C:\Program Files\totalcmd>TOTALCMD.EXE /L=C:\WINDOWS\system32\config\systemprofile\Local Settings\Application Data\MyApp\update\download 中运行时

改为

C:\Program Files\totalcmd>TOTALCMD.EXE /L="C:\WINDOWS\system32\config\systemprofile\Local Settings\Application Data\MyApp\update\download"

它不起作用但不知道如何在程序中添加"

【问题讨论】:

    标签: c# directory system total-commander


    【解决方案1】:

    我在我的问题上找到了答案,所以如果您需要为字符串变量添加双引号,请使用以下内容:

    startInfo.Arguments = string.Format("/L=\"{0}\"", GetArgument());

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-07
      • 2015-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多