How can I get the total disk space / free disk space of my windows computer ?
If there is no R function, maybe there is a windows command that I could use within the R system
function but I wasn't able to find that command.
From the Windows desktop, double-click the My Computer icon. In My Computer, highlight and right-click the drive whose capacity you'd like to determine. In the menu that appears, select Properties. The Properties window displays the used space, free space, and the total capacity of the hard drive or other drives.
Search command prompt in Windows 10, and right-click on the result and choose Run as administrator. Step 2. Type wmic diskdrive get size and press Enter. Finally, the total size of hard disk space (in pure number) is displayed in the figure below.
Though I find it really difficult to believe that a Google search for windows cmd disk space
came up empty for you, this should provide the information you need w/o the need for admin privileges:
disks <- system("wmic logicaldisk get size,freespace,caption", inter=TRUE)
disks <- read.fwf(textConnection(disks[1:(length(disks)-1)]),
widths=c(9, 13, 13), strip.white=TRUE, stringsAsFactors=FALSE)
colnames(disks) <- disks[1,]
disks <- disks[-1,]
rownames(disks) <- NULL
disks
## Caption FreeSpace Size
## 1 A:
## 2 C: 52617023488 63898120192
## 3 D:
Just thought I'd also add that this answer comes from someone who is primarily an OS X/Linux user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With