I am trying to rename a drives volume label but i get an error if the label contains a space
import subprocess
subprocess.run(['label', 'L:test 1'])
Produces this Error:
Access Denied as you do not have sufficient privileges or the disk may be locked by another process. You have to invoke this utility running in elevated mode and make sure the disk is unlocked.
The code works fine if I remove the space subprocess.run(['label', 'L:test1'])
How can I add spaces to my label?
try subprocess.run(['label', 'L:test', '1'])
.
It works via concatenation - silly, but true.