brand new cmd.exe

M

Matthias Tacke

Québec said:
Hi,

This is what I get from XP

Missing operand
But you had a look into the help of "set /?" _and_ "for /?" and you
don't intermix them?
AFAIK the ~z operator works only inner a for loop.
 
P

Phil Robyn

Matthias said:
:



But you had a look into the help of "set /?" _and_ "for /?" and you
don't intermix them?
AFAIK the ~z operator works only inner a for loop.

Here is the context of this 'moldy oldie':

- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
C:\cmd>rlist C:\cmd\demo\CompareTwoFileSizes.cmd
=====begin C:\cmd\demo\CompareTwoFileSizes.cmd ====================
01. @echo off
02. set /a size_of_file1= %~z1
03. set /a size_of_file2= %~z2
04.
05. @echo.
06. @echo File 1 (%1) size is %size_of_file1%
07. @echo File 2 (%2) size is %size_of_file2%
08. @echo.
09.
10. if %size_of_file1% GTR %size_of_file2% echo File 1 is larger than File 2.
11. if %size_of_file1% EQU %size_of_file2% echo File 1 is same size as File 2.
12. if %size_of_file1% LSS %size_of_file2% echo File 1 is smaller than File 2.
13.
14. if %size_of_file1% GTR %size_of_file2% echo copy %1 C:\learnJava\RemindMe\back /Y
15.
16. goto:EOF
=====end C:\cmd\demo\CompareTwoFileSizes.cmd ====================

C:\cmd>demo\CompareTwoFileSizes C:\cmd\demo\CompareTwoFileSizes.cmd C:\cmd\TEST\testfilesize.cmd

File 1 (C:\cmd\demo\CompareTwoFileSizes.cmd) size is 496
File 2 (C:\cmd\TEST\testfilesize.cmd) size is 160

File 1 is larger than File 2.
copy C:\cmd\demo\CompareTwoFileSizes.cmd C:\learnJava\RemindMe\back /Y

C:\cmd>dir C:\cmd\demo\CompareTwoFileSizes.cmd | find "/"
10/27/2003 11:43a 496 CompareTwoFileSizes.cmd

C:\cmd>dir C:\cmd\TEST\testfilesize.cmd | find "/"
02/27/2001 10:04a 160 testfilesize.cmd
- - - - - - - - - - end screen capture Win2000 - - - - - - - - - -
 
M

Matthias Tacke

Phil said:
Here is the context of this 'moldy oldie':
Hello Phil,
have I missed some posting, or are the batteries of your crystal ball
highcharged again?
Subject & context didn't give _me_ any clue.
- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
C:\cmd>rlist C:\cmd\demo\CompareTwoFileSizes.cmd
<snip>
 
P

Phil Robyn

Matthias said:
Hello Phil,
have I missed some posting, or are the batteries of your crystal ball
highcharged again?
Subject & context didn't give _me_ any clue.



<snip>

What I posted was the original batch file from which the single line
referred to by the hapless OP was extracted.

It is perfectly legitimate to use '%~z1' outside a FOR loop.
 
M

Matthias Tacke

Phil said:
It is perfectly legitimate to use '%~z1' outside a FOR loop.
Yes, misinterpretation by me. For /? states it for "for variables".
I couln't find any other reference in the help file. Makes life a bit
easier ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top