[Bug]: Server cannot access filesystem on new Windows install due to deprecated wmic utility #2915

Closed
opened 2026-04-25 00:11:49 +02:00 by adam · 6 comments
Owner

Originally created by @ghost on GitHub (Jul 25, 2025).

What happened?

I recently reinstalled Windows 11 (Pro, 24H2, if it matters) on my PC and was looking to set my Audiobookshelf server back up, but when I go to add a library folder, it tells me "No Folders Available." I checked out the logs and saw the error I've attached, which makes it look like the server relies on a tool "wmic" to get drive names (at least) which isn't installed on my computer. I got curious and Googled, and discovered that wmic has been deprecated as of Windows 10, version 21H1 and is apparently not included in fresh Windows 11 installs.

What did you expect to happen?

I expected to be able to access my filesystem to assign a folder to a library.

Steps to reproduce the issue

  1. Perform a fresh Windows 11 installation.
  2. Install Audiobookshelf.
  3. Try to set up a library.

Audiobookshelf version

v. 2.26.3

How are you running audiobookshelf?

Windows Tray App

What OS is your Audiobookshelf server hosted from?

Windows

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

`[FileSystemController] Failed to get windows drives Error: Command failed: wmic logicaldisk get name 'wmic' is not recognized as an internal or external command, operable program or batch file. at genericNodeError (node:internal/errors:984:15) at wrappedFn (node:internal/errors:538:14) at ChildProcess.exithandler (node:child_process:422:12) at ChildProcess.emit (node:events:524:28) at maybeClose (node:internal/child_process:1104:16) at ChildProcess._handle.onexit (node:internal/child_process:304:5) { code: 1, killed: false, signal: null, cmd: 'wmic logicaldisk get name' }`

Additional Notes

Out of curiosity I tried to run wmic in my terminal directly in case it was some kind of path issue, but nope, it's just straight-up not installed, and there doesn't appear to be a way to install it.

Originally created by @ghost on GitHub (Jul 25, 2025). ### What happened? I recently reinstalled Windows 11 (Pro, 24H2, if it matters) on my PC and was looking to set my Audiobookshelf server back up, but when I go to add a library folder, it tells me "No Folders Available." I checked out the logs and saw the error I've attached, which makes it look like the server relies on a tool "wmic" to get drive names (at least) which isn't installed on my computer. I got curious and Googled, and discovered that [wmic has been deprecated as of Windows 10, version 21H1](https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic) and is apparently not included in fresh Windows 11 installs. ### What did you expect to happen? I expected to be able to access my filesystem to assign a folder to a library. ### Steps to reproduce the issue 1. Perform a fresh Windows 11 installation. 2. Install Audiobookshelf. 3. Try to set up a library. ### Audiobookshelf version v. 2.26.3 ### How are you running audiobookshelf? Windows Tray App ### What OS is your Audiobookshelf server hosted from? Windows ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell `[FileSystemController] Failed to get windows drives Error: Command failed: wmic logicaldisk get name 'wmic' is not recognized as an internal or external command, operable program or batch file. at genericNodeError (node:internal/errors:984:15) at wrappedFn (node:internal/errors:538:14) at ChildProcess.exithandler (node:child_process:422:12) at ChildProcess.emit (node:events:524:28) at maybeClose (node:internal/child_process:1104:16) at ChildProcess._handle.onexit (node:internal/child_process:304:5) { code: 1, killed: false, signal: null, cmd: 'wmic logicaldisk get name' }` ``` ### Additional Notes Out of curiosity I tried to run wmic in my terminal directly in case it was some kind of path issue, but nope, it's just straight-up not installed, and there doesn't appear to be a way to install it.
adam added the bug label 2026-04-25 00:11:49 +02:00
adam closed this issue 2026-04-25 00:11:49 +02:00
Author
Owner

@nichwall commented on GitHub (Jul 25, 2025):

This is specific to the windows installer maintained by mikiher

https://github.com/mikiher/audiobookshelf-windows

@nichwall commented on GitHub (Jul 25, 2025): This is specific to the windows installer maintained by mikiher https://github.com/mikiher/audiobookshelf-windows
Author
Owner

@ghost commented on GitHub (Jul 25, 2025):

Hmm. I don't think so. When I search that repo for anything using wmic, nothing comes up. But when I search this one, I find the command in question (it's right here). Also someone's already asked on that repo and was directed here,

On the user end the issue can be fixed by running dism /online /add-capability /CapabilityName:WMIC~~~~ in an administrator terminal, until it gets fully removed as even an optional feature.

@ghost commented on GitHub (Jul 25, 2025): Hmm. I don't think so. When I search that repo for anything using wmic, nothing comes up. But when I search this one, I find the command in question (it's [right here](https://github.com/advplyr/audiobookshelf/blob/a5fb0d9cdb5e1d4ca9f97b02e1a55db8e99be36c/server/utils/fileUtils.js#L479)). Also [someone's already asked on that repo and was directed here](https://github.com/mikiher/audiobookshelf-windows/issues/40), On the user end the issue can be fixed by running `dism /online /add-capability /CapabilityName:WMIC~~~~` in an administrator terminal, until it gets fully removed as even an optional feature.
Author
Owner

@nichwall commented on GitHub (Jul 25, 2025):

Thanks for clarifying. I misunderstood because we get bug reports for the Windows specific installer (the tray app) in this repository when they should be reported over there.

Are you able to manually enter the path for the library, is it only the folder picker that is not working?

@nichwall commented on GitHub (Jul 25, 2025): Thanks for clarifying. I misunderstood because we get bug reports for the Windows specific installer (the tray app) in this repository when they should be reported over there. Are you able to manually enter the path for the library, is it only the folder picker that is not working?
Author
Owner

@ghost commented on GitHub (Jul 25, 2025):

I'm pretty sure I was getting the red 🚫 symbol when mousing over the spot to enter the directory path manually, but to be really honest I found the DISM fix and just did that. I'll try uninstalling the wmic feature tonight when I get home and see for sure.

Thanks!

@ghost commented on GitHub (Jul 25, 2025): I'm pretty sure I was getting the red 🚫 symbol when mousing over the spot to enter the directory path manually, but to be really honest I found the DISM fix and just did that. I'll try uninstalling the wmic feature tonight when I get home and see for sure. Thanks!
Author
Owner

@sir-wilhelm commented on GitHub (Jul 25, 2025):

You might be able to easily flip to PowerShell to get the drive letters:

PS C:\> wmic logicaldisk get name
Name
C:
D:
U:

PS C:\> powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"
C
D
U

the getWindowsDrives function will have to change a little bit.

'wmic logicaldisk get name' -> 'powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"'
drop the .slice(1), and then change let drivepath = drive + '/' to let drivepath = drive + ':/'

Test code I ran in node repl:

const { exec } = require('child_process');

exec('wmic logicaldisk get name', (error, stdout, stderr) => {
  if (error) {
    console.error('Error:', error);
    return;
  }

  const drives = stdout
    ?.split(/\r?\n/)
    .map((line) => line.trim())
    .filter((line) => line)
    .slice(1);

  const validDrives = drives.map((drive) => `${drive}/`);
  console.log('Valid Drives:', validDrives);
});

output:

Valid Drives: [ 'C:/', 'D:/', 'U:/' ]
const { exec } = require('child_process');

exec('powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"', (error, stdout, stderr) => {
  if (error) {
    console.error('Error:', error);
    return;
  }

  const drives = stdout
    ?.split(/\r?\n/)
    .map((line) => line.trim())
    .filter((line) => line);

  const validDrives = drives.map((drive) => `${drive}:/`);
  console.log('Valid Drives:', validDrives);
});

output:

Valid Drives: [ 'C:/', 'D:/', 'U:/' ]
@sir-wilhelm commented on GitHub (Jul 25, 2025): You might be able to easily flip to PowerShell to get the drive letters: ``` PS C:\> wmic logicaldisk get name Name C: D: U: PS C:\> powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name" C D U ``` the `getWindowsDrives` function will have to change a little bit. `'wmic logicaldisk get name'` -> `'powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"'` drop the `.slice(1)`, and then change `let drivepath = drive + '/'` to let drivepath = drive + ':/' Test code I ran in node repl: ```javascript const { exec } = require('child_process'); exec('wmic logicaldisk get name', (error, stdout, stderr) => { if (error) { console.error('Error:', error); return; } const drives = stdout ?.split(/\r?\n/) .map((line) => line.trim()) .filter((line) => line) .slice(1); const validDrives = drives.map((drive) => `${drive}/`); console.log('Valid Drives:', validDrives); }); ``` output: ``` Valid Drives: [ 'C:/', 'D:/', 'U:/' ] ``` ```javascript const { exec } = require('child_process'); exec('powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"', (error, stdout, stderr) => { if (error) { console.error('Error:', error); return; } const drives = stdout ?.split(/\r?\n/) .map((line) => line.trim()) .filter((line) => line); const validDrives = drives.map((drive) => `${drive}:/`); console.log('Valid Drives:', validDrives); }); ``` output: ``` Valid Drives: [ 'C:/', 'D:/', 'U:/' ] ```
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2025):

Fixed in v2.29.0.

@github-actions[bot] commented on GitHub (Aug 26, 2025): Fixed in [v2.29.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.29.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2915