尝试使用Process.Start启动msconfig,但操作系统找不到该文件 [英] Trying to use Process.Start to launch msconfig but the OS can't find the file

查看:306
本文介绍了尝试使用Process.Start启动msconfig,但操作系统找不到该文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为常用的系统实用程序,显示属性,msconfig等创建启动程序。 除了msconfig和gpedit.msc之外,我已经完成了我要尝试快捷方式的所有内容。 授予gpedit.msc可能
将无法在我的家庭系统上运行,因为它没有域安装而且看不到gpedit。 但是msconfig,无论我使用Process.Start("msconfig")还是Process.Start("C:\windows \ system32 \ msconfig.exe")
它都会抛出异常时间说它找不到文件。 如果我从命令提示符或运行框启动它,它每次都会触发。 有什么想法? 谢谢!

I'm trying to create a launcher program for commonly used system utilities, display properties, msconfig, etc.  I've gotten everything to launch that I'm trying to shortcut, except for msconfig and gpedit.msc.  Granted the gpedit.msc probably won't work on my home system since it doesn't have a domain installation and won't see the gpedit.  However the msconfig, regardless of if I use Process.Start("msconfig") or Process.Start("C:\windows\system32\msconfig.exe") it throws an exception every time saying that it can't find the file.  If I launch it from the command prompt or run box, it fires off every time.  Any thoughts?  Thanks!

推荐答案

转到项目属性的Build设置。 请务必设置"配置"到"所有配置"。 
假设您有64位系统,请更改"平台目标"。到"x64"。我不知道为什么会这样。我不知道如何使应用程序适用于x86和x64。
Go to the Build settings of the project's properties. Be sure to set the "Configuration" to "All Configurations".  Assuming you have a 64-bit system, change "Platform target" to "x64". I don't know why that works. I don't know how to make the application work for both x86 and x64.


这篇关于尝试使用Process.Start启动msconfig,但操作系统找不到该文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆