linsk icon indicating copy to clipboard operation
linsk copied to clipboard

"wmic" command on windows is deprecated

Open ty802 opened this issue 1 year ago • 6 comments

The process of passing a diskdrive on windows seems to be using the wmic command witch is deprecated and does not come default on new versions of windows see https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features

ty802 avatar Nov 07 '24 19:11 ty802

It currently can be re added. Settings > System > Optional Features > View Features > WMIC

LJAM96 avatar Dec 29 '24 15:12 LJAM96

Thanks @LJAM96. Unfortunately, I don't have enough resources to address this at this time. A PR would be welcome, though.

AlexSSD7 avatar Dec 31 '24 13:12 AlexSSD7

It currently can be re added. Settings > System > Optional Features > View Features > WMIC

That doesn't seem to be the case anymore

raffaem avatar Feb 17 '25 17:02 raffaem

What about the PowerShell command

Get-CimInstance -ClassName Win32_diskdrive

?

See https://stackoverflow.com/questions/57121875/what-can-i-do-about-wmic-is-deprecated

raffaem avatar Feb 17 '25 17:02 raffaem

Nothing, you would get stuck at the next step of the process:

C:\Windows\System32>%USERPROFILE%\go\bin\linsk ls dev:\\.\PHYSICALDRIVE1
time=2025-02-17T19:36:15.963+01:00 level=WARN msg="Using raw block device passthrough. Please note that it's YOUR responsibility to ensure that no device is mounted in your OS and the VM at the same time. Otherwise, you run serious risks. No further warnings will be issued." caller=vm
time=2025-02-17T19:36:15.998+01:00 level=ERROR msg="Failed to create vm instance" error="configure vm cmd block device passthrough: check whether device seems to be mounted (path '\\\\.\\PHYSICALDRIVE1'): exec wmic cmd: exec: \"wmic\": executable file not found in %PATH%"

raffaem avatar Feb 17 '25 18:02 raffaem

Make the change here: https://github.com/AlexSSD7/linsk/blob/4c98a8500c4e73ecadeb0c354f07a6375eceb4d9/osspecifics/osspecifics_windows.go#L62

Then make a pull request.

F9Alejandro avatar Mar 28 '25 18:03 F9Alejandro