devcon restart not working on windows7 - windows

I am trying to run devcon command on windows7 as below but this is stuck forever,if I right-click on "scan for hardware changes" it is stuck aswell,how can I activate a COM port via commandline using devcon?is there a better way?
devcon.exe restart "#USB\VID_05C6&PID_9302&MI_01\6&1E2FC975&0&0001"

Related

wsl still not recognized after enabled in dism

I apologize if this was posted, I did go through a number of posts first.
I am attempting to run a linux VM on my desktop using WSL 2, however I continuously get the error: "'wsl' is not recognized as an internal or external command,
operable program or batch file."
I have enabled it multiple times using the command dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart in an elevated CMD.
Note: I am using the Microsoft Insiders Dev mode on my computer. I configured it today and did restart to settle the update.
It seems like you need to enable wsl from Windows Features.
Click Windows > Search "Turn Windows features on or off" > Open the
list of features > Select "Windows Subsystem for Linux", enable it and
restart
It is recommended to enable "Virtual Machine Platform" and "Hyper-V" as well.
Please refer to the image below.

Run appx file in current Windows 10 device using the PowerShell cmdlets

I have an appx file which was generated elsewhere and I would like to test it in my Windows 10 machine.
The appx file is already available to me and I can deploy it to other devices using the WinAppDeployCmd, which works for the XBox One. This works perfectly with the following command:
WinAppDeployCmd install -file "!MY_FILE!" -ip "!DEVICE_IP!" -pin "!DEVICE_PIN!"
My question is, is there a similar command to simply run my .appx in the windows machine where it currently is? Is there perhaps even a way to use the WinAppDeployCmd to install it in the current machine?
I don't know about cmd, but in PowerShell you can use
Add-AppxPackage -Path C:\Users\User\MyApp.appx
If the package is unsigned, you will need to enable developer mode in Windows 10 before it can be installed.
Open Settings.
Click on Update & security
Click on For developers.
Under “Use developer features”, enable Developer mode.
More information on Add-AppxPackage: https://technet.microsoft.com/en-us/library/hh856048.aspx
Update: Regarding using WinAppDeployCmd for this see: Can I Use WinAppDeployCmd install, update on pc itself

PnPutil commands to uninstall the display adapter driver does not work

I am currently trying to uninstall display adapter driver in power shell.
I can simply go to device manager to find display adapter and uninstall the driver and then install the new driver. But I want to write an automated script to make it easy.
I tried to use "pnputil.exe -f -d oem##.inf" in power shell to uninstall the display adapter driver.
But it did not work and gave me something like that
"Deleting the driver package failed: One or more devices are presently installed using the specified INF"
Does anyone know how can I solve this problem and make pnputil work?
This isn't a PowerShell question really, as it's a window util.
from running pnputil /?
/delete-driver <oem#.inf> [/force]
Delete driver package from the driver store.
/force - delete driver package even when it is in use by devices.
so running pnputil.exe /delete-driver oem##.inf /force should work for you.
Example removing a device using the driver first on the commandline with devon. Devon comes with the Window SDK. Windows SDK - Windows app development _ Microsoft Developer The pnputil command should work after that.
devcon remove "HDAUDIO\FUNC_01&VEN_1013&DEV_4206&SUBSYS_106B0600"

Abort NSIS silent installer

I've created an NSIS installer that installs a certain program. Everything works fine but I wonder if it is possible to abort the installation when it runs in silent mode.
So is there a way to abort an installation when I install an NSIS installer via the command line with this command: installer.exe /S /D=Path/To/Directory?
I tried to abort it via CTRL+C as it works for other programs, too, but that didn't work.
NSIS is not a console program so it is not going to respond to console keyboard shortcuts.
Even if you could trick it into behaving like a console program when started silent it is not going to work in a stable manner because CTRL+C will just kill the process unless the program has added extra code to handle the aborting events...

script to disable then enable WWAN device

My 3G wireless device is not available after I put my PC to sleep and then wake the PC. In the Connection Manager it says "Device disabled by Device Manager".
So I go to the device manager, disable the device, then enable the device. Then the Connection Manager can use it again.
I'd like to disable, then enable the device with some script which I can automatically execute when the PC wakes from sleep or hibernate.
Can this be achieved with a script? My OS is Windows 64bit and it seems that the DevCon command-line utility is not available for 64 bit (except Itanium processors).
Newer versions of the Windows Driver Kit contain a devcon.exe which will run on Windows 7 / 64 bit.
After making sure devcon.exe was in my PATH (e.g. c:\Windows\System32), I used this command at a DOS prompt to find the hardware ID of my 3G Network Adapter:
devcon hwids *usb*
Then this batch file which I Run As Administrator from the desktop does the job:
CLS
devcon status "USB\VID_03F0&PID_371D"
#ECHO.
devcon disable "USB\VID_03F0&PID_371D"
#ECHO.
devcon enable "USB\VID_03F0&PID_371D"

Resources