From 6c57fcf31c3b427d3e48ae5d18d7a7b6d70de5e7 Mon Sep 17 00:00:00 2001 From: dyphire Date: Sun, 15 Dec 2024 10:31:09 +0800 Subject: [PATCH] winroot: replaces the deprecated wmic command wmic disabled by default since Win11 24H2 --- addons/winroot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/winroot.lua b/addons/winroot.lua index 13da117..27d91fa 100644 --- a/addons/winroot.lua +++ b/addons/winroot.lua @@ -17,12 +17,12 @@ local function get_drives() name = 'subprocess', playback_only = false, capture_stdout = true, - args = {'wmic', 'logicaldisk', 'get', 'caption'} + args = {'fsutil', 'fsinfo', 'drives'} }) if result.status ~= 0 then return msg.error('could not read windows root') end local root = {} - for drive in result.stdout:gmatch("%a:") do + for drive in result.stdout:gmatch("(%a:)\\") do table.insert(root, drive..'/') end return root