Solved WSL users - to re-enable wmic command


jimbo45

Well-known member
Pro User
VIP
Local time
2:04 AM
Posts
5,947
Location
Hafnarfjörður IS
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Hi folks
If you are using WSL and want to attach complete physical disks if system doesn't think they are US B drives - especially if they have Linux file systems on them to your WSL machine the wmic command was useful but has been deprecated.

But you can still re-enable it as follows :

From Powershell (not inside WSL !!) in Ad min mode
DISM /Online /Add-Capability /CapabilityName:WMIC~~~~

note you do need the 4 ~'s. !!! Not a typo.

Wait until complete and then restart the powershell command (again in admin mode).

Cheers
jimbo
 

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2
Now's the time to learn how to do this without WMIC, since it will be gone in 27H2.

If you're following this advice (How to Use Dedicated Disks in Wsl), the equivalent in PowerShell is:
Code:
PS C:\Windows\System32> Get-WmiObject Win32_DiskDrive | select Caption,DeviceID,Model,Partitions,Size | Format-Table

Caption                           DeviceID           Model                             Partitions        Size
-------                           --------           -----                             ----------        ----
VMware Virtual NVMe Disk          \\.\PHYSICALDRIVE0 VMware Virtual NVMe Disk                   4 85896599040
VMware Virtual Storage USB Device \\.\PHYSICALDRIVE1 VMware Virtual Storage USB Device          1 34356994560
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Now's the time to learn how to do this without WMIC, since it will be gone in 27H2.

If you're following this advice (How to Use Dedicated Disks in Wsl), the equivalent in PowerShell is:
Code:
PS C:\Windows\System32> Get-WmiObject Win32_DiskDrive | select Caption,DeviceID,Model,Partitions,Size | Format-Table

Caption                           DeviceID           Model                             Partitions        Size
-------                           --------           -----                             ----------        ----
VMware Virtual NVMe Disk          \\.\PHYSICALDRIVE0 VMware Virtual NVMe Disk                   4 85896599040
VMware Virtual Storage USB Device \\.\PHYSICALDRIVE1 VMware Virtual Storage USB Device          1 34356994560
Thanks
Trying now to mount - got error not in fstab or similar -any ideas !!!

Screenshot 2026-08-03 100624.webp


the disks are XFS formatted - but I've installed XFSPROGS so the kernel should be able to handle XFS files -- if not then that's a bit of a "bummer" as I don't like ext4 !!!!.
Cheers
jimbo
 

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2
Solved !!!
I needed after the mount to add the parameter --bare !!!

Screenshot 2026-08-03 104428.webp

As the disk is XFS formatted - I installed XFSPROGS and restarted the WSL system.
sdd is the Linux disk and is useable as per :

Screenshot 2026-08-03 105113.webp

I think I could have fun with this stuff !!!

(Next project -- seeing if I can get some sort of GUI type programs running in the WSL - I don't need full desktop though !! !!!!).
cheers
jimbo
 

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2

Latest Support Threads

Back
Top Bottom