Posts

Showing posts from April, 2021

Use Devcon to detect Device (by Hardware IDs)

 C:\Windows\system32>devcon find *HID\VID_0F39*PID_1083*MI_00* HID\VID_0F39&PID_1083&MI_00\7&4FD8553&0&0000                : HID Keyboard Device HID\VID_0F39&PID_1083&MI_00\7&162E37F9&0&0000               : HID Keyboard Device 2 matching device(s) found. C:\Windows\system32>devcon status *USB\VID_05E3*PID_0626*REV_6205* USB\VID_05E3&PID_0626\5&36A3B657&0&13     Name: 1 matching device(s) found. C:\Windows\system32>devcon status *USB\VID_05E3*PID_0626*REV_6205* USB\VID_05E3&PID_0626\5&36A3B657&0&13     Name:     Driver is running. 1 matching device(s) found.

WMIC scripts using command line (install msi package, Environment Variable)

MSI package un-install script wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Uninstall MSI package re-install script wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Reinstall Set Computer System Time wmic os where(primary=1) call setdatetime 20070731144642.555555 480 Example for Use a batch file to create System Environment Variable  @ECHO OFF REM Command line need to use Administrator authority REM set system Environment variable, "C:\" REM e.g. wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;C:\" pause Create a new environment variable , Name as "home" Value as "%HOMEDRIVE%%HOMEPATH%" wmic ENVIRONMENT create name="home",username="<system>",VariableValue="%HOMEDRIVE%%HOMEPATH%"