-----Original Message-----
Galop said:
I want to perform COPY from a remote folder (Network
mapped) to a local folder on my W2K system. The copy
should be excuted only if there are files in the remote
folder (else go to exit the batch executeion). To acheive
this, how should I script my commands in the batch file?
Thanks.
Galop.
- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
C:\cmd>demo\HowManyFiles
Please specify the directory
C:\cmd>demo\HowManyFiles c:\junkdir
Directory c:\junkdir contains 21 files.
C:\cmd>demo\HowManyFiles c:\snarf
Directory c:\snarf doesn't contain any files.
C:\cmd>qblist demo\HowManyFiles.cmd
===== begin file C:\cmd\demo\HowManyFiles.cmd =====
01. @echo off
02. if [%1]==[] echo Please specify the directory&goto :EOF
03. for /f "tokens=1" %%a in (
04. 'dir %1 ^| find "File(s)"'
05. ) do set /a number_of_files=%%a
06. if %number_of_files% EQU 0 (
07. echo Directory %1 doesn't contain any files.
08. ) else (
09. echo Directory %1 contains %number_of_files% files.
10. )
===== end file C:\cmd\demo\HowManyFiles.cmd =====
- - - - - - - - - - end screen capture Win2000 - - - - - - - - - -
--
Phil Robyn
Univ. of California, Berkeley
u n z i p m y a d d r e s s t o s e n d e - m a i l
.