从c#applicxation读取驱动程序 [英] read driver from c# applicxation

查看:100
本文介绍了从c#applicxation读取驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我尝试创建一个应用程序,从串口获取一些信息,bios信息,并从设备管理器中读取驱动程序

I try to create an application to get some info from windows like serial, bios info and read the driver from device manager

对于bios和序列号I 使用此类  ProcessStartInfo  (bios和serial正在使用wmic)

For bios and serial number I  used this class ProcessStartInfo  (bios and serial are working using wmic)

例如

  for pnputil, 我写下了

 for pnputil,  I wrote down

,它不起作用

, it doesn't work

我的错误在哪里?

  private void bt_controller_Click(object sender,EventArgs e)

        {

            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(" CMD.EXE"," / K pnputil -e");



            info.Verb =" open";


            System.Diagnostics.Process.Start(info);

        }

 private void bt_controller_Click(object sender, EventArgs e)
        {
            System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("CMD.EXE", "/K pnputil -e");

            info.Verb = "open";

            System.Diagnostics.Process.Start(info);
        }

我将不胜感激任何帮助

谢谢

Jose

推荐答案

您的代码适用于我。 该错误没有多大意义,因为pnputil.exe与cmd.exe位于同一目录中,显然它可以找到它。 如果您执行"dir \windows \ system32 \ pnputil.exe",它是否找到该文件?

Your code works fine for me.  The error doesn't make much sense, because pnputil.exe is located in the same directory as cmd.exe, which it was obviously able to find.  If you do "dir \windows\system32\pnputil.exe", does it find the file?

如果您运行"PATH"而不是"pnputil -e",你在路径列表中看到\ windows \ system32吗?

If you run "PATH" instead of "pnputil -e", do you see \windows\system32 in the path list?


这篇关于从c#applicxation读取驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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