当前位置:编程学习 > C#/ASP.NET >>

winform中程序自动安装inf驱动文件问题


string jstarpath = Application.StartupPath + "\\jstar.inf";
                    if (File.Exists(jstarpath))
                    {
                        Process p = new Process();
                        p.StartInfo.FileName = "cmd.exe";
                        p.StartInfo.UseShellExecute = false;
                        p.StartInfo.RedirectStandardInput = true;
                        p.StartInfo.RedirectStandardOutput = true;
                        p.StartInfo.RedirectStandardError = true;
                        p.StartInfo.CreateNoWindow = true;
                        p.Start();
                        string Cmdstringp = "rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 " + jstarpath; //CMD命令
                        p.StandardInput.WriteLine(Cmdstringp);
                        Thread.Sleep(5000);
                        p.StandardInput.WriteLine("exit");
                    }
                    else
                        log.WriterLog(@"C:\HGLogInfo", "UnderlySetup", "安装文件不存在");



上面的代码,在32位机器里面是能够正常安装的,但在64位的机器里面却不能够正常安装,当然.如果我在64位机器里面手动右键安装的话.是能够正常安装的,我的inf文件是兼容64与32的.
求高手批教下,这是为什么? --------------------编程问答-------------------- 提权?

--------------------编程问答-------------------- 请问楼主,我的inf为啥安装不了在xp。我用的你的这段代码。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,