I have a windows 10 laptop (only a couple of years old) and an older printer (HP LaserJet 1320) that is not wireless. I often wander with my laptop, hooking up the printer only when I need to print. Most of the time I need to manually scan for hardware changes. I would like to create a shortcut (command line, bat file, or some other, better solution) to perform this task to make it easier for my less tech-savvy family members. Ideally, I would like to be able to connect/disconnect the printer at will and have it work without any manual intervention, but I'll take what i can get.


From my research its best to use DevCon to do a hardware scan, please see below:

Download Windows Driver Kit - https://go.microsoft.com/fwlink/?linkid=873060

Link was obtained from this page (https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)

Install the Windows Driver Kit, at end of the installation untick the visual studio integration installation if ticked.

Then create a batch file with the following contents:

"C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon" rescan

This will need to be ran as administrator.

Double Click solution:

Move the batch file to another location on the computer. Right click the batch file and select "Send To" -> "Desktop (Create Shortcut)".

Go to the desktop and right click on the shortcut and select "Properties", on the "Shortcut" Tab click "Advanced..." and tick "Run as administrator".

This will still cause the screen to dim with a notification but when you click yes it should work.

  • is it possible to scan only specific hw range, remove pause and add it as scheduled admin job? maybe even check system state for fullscreen/high priority jobs/apps before allowing actual scan – Sampo Sarrala Oct 1 '18 at 21:13
  • Thanks for this. I installed devcon, confirmed its filepath location, and ran the batch file as sated. When I run it, the command window opens with the message "scanning for hardware. devcon failed." I'm googling, but no joy. – Michael_B Oct 1 '18 at 22:45
  • Hi Michael, have you tried running the batch file as administrator? Do the other users have access to admin? – CraftyB Oct 2 '18 at 5:43
  • the whole family uses a single ID to access windows, it should be an admin profile. beyond that, i'm out of my depth. – Michael_B Oct 2 '18 at 13:24
  • Could you please try right clicking your batch file and clicking "Run as administrator"? – CraftyB Oct 2 '18 at 13:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.