简体   繁体   中英

System.ComponentModel.Win32Exception: Path not found

In my WPF Application i can use this command:

Process.Start(@"C:\Windows\System32\appwiz.cpl");

But this is not working:

Process.Start(@"C:\Windows\System32\firewall.cpl");

i got (in german): System.ComponentModel.Win32Exception: "Das System kann die angegebene Datei nicht finden". File not found. But when i put C:\Windows\System32\firewall.cpl to my file Explorer, Firewall.cpl is opening. I tryed some others:

OK:

  • desk.cpl
  • hdwwiz.cpl
  • inetcpl.cpl
  • intl.cpl
  • joy.cpl
  • main.cpl
  • mmsys.cpl

NOK:

  • Firewall.cpl
  • igfxCPL.cpl
  • compmgmtlauncher.exe

What ist the Problem?

According to the comments,the solution is c:\windows\sysnative\firewall.cpl or Project > Properties > Build tab , "Prefer 32-bit" unticked.

https://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector

You can also refer to the two answers under this link.

how do i link my windows form with .NET framework to steam without build errors

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM