Process.Start dirquota.exe - 系统找不到指定的文件

发布于 2024-09-18 07:19:20 字数 371 浏览 3 评论 0原文

我用这个头撞墙大约两天了。

我正在使用 System.Diagnostics.Process 来执行 dirquota.exe。我在 .Start() 处捕获一个异常,即“系统找不到指定的文件”。

我现在正在做:

            foreach (var fi in new DirectoryInfo(@"C:\Windows\System32\").GetFiles())
            {
                Console.WriteLine(fi.Name);
            }

这会输出该目录中除 dirquota.exe 之外的几乎所有文件。有人吗?

干杯。

Banging my head against the wall for around 2 days with this one.

I am using a System.Diagnostics.Process to execute dirquota.exe. I catch an exception at .Start() which is "The system cannot find the file specified".

I am now doing:

            foreach (var fi in new DirectoryInfo(@"C:\Windows\System32\").GetFiles())
            {
                Console.WriteLine(fi.Name);
            }

This outputs pretty much every file in that directory apart from dirquota.exe. Anyone?

Cheers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

完美的未来在梦里 2024-09-25 07:19:20

您运行的是 64 位版本的 Windows 吗?查看 c:\windows\syswow64,这是 32 位程序的所在地。

Are you running on a 64-bit version of Windows? Look in c:\windows\syswow64, home of the 32-bit programs.

浅听莫相离 2024-09-25 07:19:20

我刚刚遇到了同样的错误,问题是可执行程序被编译为 x86 并在 64 位操作系统中运行。

将项目“平台目标”更改为 AnyCPU 即可修复此问题。

I just hit this same error and the issue was that the executable program was compiled as x86 and running it in a 64 bit OS.

Changing the project 'Platform Target' to AnyCPU fixes it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文