Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Compare two numbers w/Batch

Original Message
Name: masimar
Date: October 12, 2007 at 07:17:22 Pacific
Subject: Compare two numbers w/Batch
OS: Na
CPU/Ram: Na
Model/Manufacturer: Na
Comment:
I'm working on a backup batch program to copy directories to a pen drive somewhat automatically and thought it would be nice to check available space on the pen drive before going through the whole xcopy process on a large directory. I really just need to compare two numbers and determine which is larger but I'm stumped. I've googled my fingers raw.
Can anybody help? The following are examples. 1) directory size, 2)available space

Thanks in advance.

1,307,791,263

1,254,895,616

Mark


Report Offensive Message For Removal


Response Number 1
Name: IVO
Date: October 12, 2007 at 12:49:02 Pacific
Subject: Compare two numbers w/Batch
Reply: (edit)
What you want to achieve is related to the OS you are running, i.e. that is easy under NT kernel systems (Win NT/2K/XP) but hard in DOS based environments (Win 9X/ME).

Assuming you are running a NT Windows, the code is

Set DirSize=1,307,791,263
Set DirSize=%DirSize:,=%
Set AvSpace=1,254,895,616
Set AvSpace=%AvSpace:,=%

If %DirSize% gtr %AvSpace% GoTo :TooHuge

To know more type If /? at prompt (Win NT/2K/XP only).


Report Offensive Follow Up For Removal

Response Number 2
Name: masimar
Date: October 13, 2007 at 19:58:07 Pacific
Subject: Compare two numbers w/Batch
Reply: (edit)
Thanks dor the response.

Yeah, I forgot to say it was NT. What you described is just what I wanted.

Thanks

Mark


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Compare two numbers w/Batch

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC