首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >c#通过total-commander打开C:\Windows\system32中的文件夹

c#通过total-commander打开C:\Windows\system32中的文件夹
EN

Stack Overflow用户
提问于 2013-10-24 18:59:57
回答 1查看 703关注 0票数 1

当我在cmd中手动运行命令时,我有一个小问题,使用total- command打开windows系统文件夹是可以的,但当它以ProcessStartInfo身份运行时就不行了。此问题发生在Windows XP上,Windows 7参数(路径)略有不同,但可以正常工作。

代码语言:javascript
复制
            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,不知道为什么有人可以帮助我?

编辑:当我在没有"的命令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"

它不工作,但不知道如何在程序中添加"

EN

回答 1

Stack Overflow用户

发布于 2013-10-25 18:33:21

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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19564074

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档