----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

ListFreeM

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Types of
.Mount/\Commands

ListValue Series

.ListValue
Series

  ListAvail | ListCD | ListFree | ListFreeM | ListIPAddr | ListIPGateway | ListIPMask | ListMac | ListNic

.ListFreeM

Description

  1. Displays the available free space (in Millions of bytes) on the current drive
  2. Saves the value in #FreeM
  3. Saves the previous value of #FreeM (if it exists) in #Previous_#FreeM
  4. Sets errorlevel based on the result
     
Using this offset, we can easily perform mathematical calculations on values up to 1.776 Petabytes (PB), 1,818 Terabytes (TB) or 1,862,645 Gigabytes (GB), without exceeding the limits of the native shell scripting environment.

Syntax

%.GetFreeM%    

Parameters and Switches

none

   

Errorlevels and Output Variables

Display to
STDOUT

 

Value of
#Free

 

Error
Level

  Description of Result

0

 

Actual Bytes
(in Millions)

 

123

  Less than 1M bytes free

1 to 999

 

Actual Bytes
(in Millions)

 

3

  Less than 1,000M bytes free

1000
to
999999

 

Actual Bytes
(in Millions)

 

2

  Less than 1,000,000M bytes free

1000000
to
999999999

 

Actual Bytes
(in Millions)

 

1

  Less than 1,000,000,000M bytes free

1000000000
to
2000000000

 

Actual Bytes
(in Millions)

 

0

  Bytes free is between 1,000,000,000M and 1,999,999,999M

2000000000

 

Actual Bytes
(in Millions)

 

0

  Bytes free is 2,000,000,000M or greater

Examples, Notes and Instructions

NT
2K
XP
K3
C:\GuardPost>%.GetFreeM%
1925
C:\GuardPost>ECHO:%Errorlevel%
2
C:\GuardPost>SET #Free
#FreeM=1925
C:\GuardPost>
D:
D:\>%.GetFreeM%
11
D:\>ECHO:%Errorlevel%
3
D:\>SET #FreeM
#Free=11
D:\>SET #Previous_#Free
#Previous_#Free=1925

  • All output is in whole Millions of bytes (1,000,000) NOT Megabytes (1,048,576)
  • Output is displayed to STDOUT
  • To suppress console display, use

    %.GetFreeM% %.Quiet%

{errorlevel and output variable(s) will still be available}


.ListValue
Series

  ListAvail | ListCD | ListFree | ListFreeM | ListIPAddr | ListIPGateway | ListIPMask | ListMac | ListNic

Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
#Free   Free space on current drive - values of 2,000,000,000 or greater will be displayed as 2000000000
#Free_d   Free space on Drive d (in bytes, where d is any accessible local or remote drive)
#FreeM_d   Free space on Drive d (in Millions of bytes, where d is any accessible local or remote drive)

 

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\