Saturday 15 March 2014

Windows batch file to get C:\ drive total space and free space available -


I need a bat file to get in C: Total space available in GB (Jiga bytes) available in Windows Location

Note: I do not want to use any external utilities.

Cut the 9 bytes size size to get the shape in GB:

  @OKO close & amp; Setlokal envelopedexpression set "Volume = C:" For / F "Token = 1 * Delimism =" %% IN ('Fsutil Volume DiscFree% Volume%') DO (SET "Diskfree =! DiskTotal!" Set "DiskTotal =! Discovered! "SET" discovery = %% j ") FOR / f" Token = 1,2 "%% i IN ("% disktotal %% diskwail% ") Set" DiscTetL = %% i "& amp; SET "Discovery = %% J" (volume% volume% info for ECHO (total% discountload: ~ 0, -9% GB ECHO (beneficial% discovery: ~ 0, -9% GB) & gt; Size .txt type Size Txt   

CMD can only calculate with the number up to 2 ^ 31-1 (2,147,483,647 ~ 2.000001 gigabytes)

No comments:

Post a Comment