Re: File Size Check
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Wed, 30 Jan 2008 00:24:54 +0100
"Pete T" <PeteT@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F353EE6-1A67-427C-B108-9A65A1C04438@xxxxxxxxxxxxxxxx
I have a simple batch file that FTP's out to a server, logs in, retrieves a
file and places it on my server and then here's where I run into a
problem.
When it was written in XP the batch then checked the size of the file and
if
it was greater than 0, the batch ended and was done. If the file was not
greater than 0, it slept for 20 minutes (echo sleep 1200) and then re-ran
the
FTP process.
Now that this is on Windows 2000, I can't figure out how to make it work.
Here are the two files that were run:
@echo on
del para2.txt
echo open XXXXXXXXXXXXXX >> para2.txt
echo user XXXXXXXXXXXXXXXXX >> para2.txt
echo binary >> para2.txt
echo hash on >> para2.txt
echo GET XXXXXXXXX >> para2.txt
echo DEL XXXXXXXXX >> para2.txt
echo quit >> para2.txt
progs.bat abc.123.tag
@echo on
del %1
:START
ftp -n -s:para2.txt
if %~z1 GTR 0 goto :END
sleep 1200
goto :START
:END
del para2.txt
Any ideas on how to make this work in Windows 2000?
Since you're not reporting what exactly happens under
Win2000, it's a little hard to say what's wrong. However,
the batch file below will work both under WinXP and under
Win2000. Note that for ease of maintenance it is now one
single file.
@echo off
set FileName=xxxxxxxxx
set Site=ftp.PeteT.com
set User=PeteT
echo> para2.txt open %Site%
echo>> para2.txt user %User%
echo>> para2.txt binary
echo>> para2.txt hash on
echo>> para2.txt GET %FileName%
echo>> para2.txt DEL %FileName%
echo>> para2.txt quit
if exist %FileName% del %FileName%
:START
ftp -n -s:para2.txt
for %%a in (%FileName%) do if %%~za GTR 0 goto END
ping localhost -n 1200 > nul
goto :START
:end
del para2.txt
.
- Follow-Ups:
- Re: File Size Check
- From: Tom Lavedas
- Re: File Size Check
- Prev by Date: Re: some further comments...
- Next by Date: script to add domain user to computers
- Previous by thread: HELP: Event handling for WIA with VBScript
- Next by thread: Re: File Size Check
- Index(es):
Relevant Pages
|