我正在尝试在C#中使用devcon.exe(其他安装驱动程序和输入硬件ID的方法,请不要输入inf信息) [英] I'm trying to use devcon.exe in C# (other ways to install driver and poing a Hardware ID, don't inf please)

查看:222
本文介绍了我正在尝试在C#中使用devcon.exe(其他安装驱动程序和输入硬件ID的方法,请不要输入inf信息)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我正在完成有关驱动程序的帮助.

开始,我使用DPInst,但是它不能在任何参数中使用.

当调用诸如"devcon install xxxxxxx.inf * xxxxxxx"之类的浴文件时,Devcon可用.需要编辑devcon.exe的UAC才能打开.在C#中,我从没做过.

所有bath命令的升级权限均失败.

是否有没有安装infInstall的驱动程序的库?无法在我的驱动程序上工作.我必须指出HardwareID!谢谢!

-------

尝试在cmd中调用devcon

            System.Diagnostics.Process p =新的System.Diagnostics.Process();
            p.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec");
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.Verb ="runas";
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.Arguments = SourcePath + @"\\ x64" + @" \\ devcon.exe安装xxxx.inf xxxxxxx" ;;
            p.Start();

它也不起作用,返回devcon.exe失败.我想这是由UAC引起的.

解决方案

ChingHaituen Ji,

谢谢您在这里发布.

我们不是Devcon的专家.根据我的搜索,也许您可​​以将StartInfo.FileName设置为"Devcon".

有关更多详细信息,您可以参考 这是MSDN中的文章 我希望这会有所帮助.

温迪


Hello. I'm finishing a helper about driver.

Begining, I use DPInst but it can't work in any arguments.

Devcon is available when a bath file call up like"devcon install xxxxxxx.inf *xxxxxxx". It's need to edit the devcon.exe's UAC to open. In c# I never worked it.

All the bath command to upgrade permission are failed.

Is there any lib to install the driver without infInstall? Can't work on my driver. I must to point the HardwareID!Thanks!

-------

Try to call the devcon in cmd

            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec");
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.Verb = "runas";
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.Arguments = SourcePath + @"\\x64" + @"\\devcon.exe install xxxx.inf xxxxxxx ";
            p.Start();

It's also not work and return devcon.exe failed. I guess it's caused by UAC.

解决方案

Hi ChingHaituen Ji,

Thank you for posting here.

We are not experts for Devcon. Based on my search, maybe you could set StartInfo.FileName to "Devcon".

For more details, you could refer to How do I run Command line commands from code in SO.

And here is an article in MSDN Device Console (DevCon.exe) Examples. In this article, it shows a lot of examples about Devcon.

I hope this would be helpful.

Best Regards,

Wendy


这篇关于我正在尝试在C#中使用devcon.exe(其他安装驱动程序和输入硬件ID的方法,请不要输入inf信息)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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