-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getVolumes - WMIC.exe deprecated #163
Comments
I'm using windows11 insider and wmic.exe does not exist there |
We can't make any changes until a clear replacement is available. Unfortunately it is not clear to me (yet) what that would be. It would have to be something that works on both Windows 10 and Windows 11 https://github.com/thomasp85/shinyFiles/blob/master/R/aaa.R#L82-L86 If you have suggestions, or want to create a pull request, please let us know |
It can be replaced by running a powershell command:
As I don't have wmic I don't know how the volume names usually look when using getVolumes() All Windows come installed with powershell . |
Thanks for this starting point. However, on my system that only get the C drive. Not the 3-4 other mounted drives. I think Get-PSDrive may be the tool we will need. If you have ideas, please us know. |
I had the problem that Warning in system(paste(wmic, "/FAILFAST:1000 logicaldisk get VolumeName"), : I came up with a solution that worked for me using PowerShell:
Can also be reduced to one powershell call (reduces time from ~1s to ~0.3s)
I hope this can help |
Sorry for the delay. I adapted your code and included it in the GitHub version of shinyFiles. Please take a look and let us know if you encounter any issues. Thanks BTW I recently upgrade to Win 11 and WMIC is still present. It is good to have this change, regardless |
@Mailinnia After a fair amount of testing the approach adapted from your code seems to work well. Thanks again for reporting! |
It seems that getVolumes on windows uses wmic.exe which is deprecated, so I can't use it to get all my drives.
"The WMIC tool is deprecated in Windows 10, version 21H1 and the 21H1 semi-annual channel release of Windows Server. This tool is superseded by Windows PowerShell for WMI. Note: This deprecation only applies to the command-line management tool. WMI itself is not affected." Windows 10 features we're no longer developing 12/01/2021
The text was updated successfully, but these errors were encountered: