简体   繁体   中英

How to configure device installation time-out using c#

Windows has a default time out for device installation for 5 minutes, which is not enough for slow computer or computer that has many devices attached. I found there is a computer policy that can configure this time out value.

1. Click Start > Run, type gpedit.msc, and click OK.
2. In the left pane, go to Computer Configuration > Administrative Templates > System > Device Installation.
3. In the right pane, click Configure device installation time-out and click Policy Setting.
4. In the popup that appears, select the Enabled option.
5. Increase the value of Device Installation Time (in seconds) option. For example, set it to 1800 (30 minutes).
6. Click Apply and then click OK. 

Reference

However, this involves user interaction, and I want to find a programmatic way to configure it, better in C#. Any ideas?

Thanks.

You can obtain such info (which is stored in the Windows registry) from the Group Policy Settings Reference for Windows and Windows Server .

from here you can obtain the registry entry where the Configure device installation time-out is stored.

HKLM\Software\Policies\Microsoft\Windows\DeviceInstall\Settings!InstallTimeout 

from this point is very straightforward modify such value using the .Net Registry Class .

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