Re: Anyone know how to complete this script?
From: David H. Lipman (DLipman~nospam~_at_Verizon.Net)
Date: 01/27/05
- Next message: johnfli: "add/remove programs"
- Previous message: anthonycont: "Re: I can't start Windows XP after I installed Windows 2000"
- In reply to: Zak: "Anyone know how to complete this script?"
- Next in thread: Zak: "Re: Anyone know how to complete this script?"
- Reply: Zak: "Re: Anyone know how to complete this script?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 Jan 2005 13:05:14 -0500
You can use a "for loop" and start with a range like 4420 - 4424
Then you can set an envionmental variable such as "DAT" and call it in a script
Then you can create a text file (FTP-CMD.TXT) of commands that can then be used by using FTP
with the switch -s:FTP-CMD.TXT
In the batch file use file redirection such as the following to create the text file ...
echo open ftp.nai.com >FTP-CMD.TXT
echo anonymous >>FTP-CMD.TXT
echo nospam@spam.com >>FTP-CMD.TXT
echo cd pub/antivirus/superdat/intel >>FTP-CMD.TXT
echo lcd C:\ >>FTP-CMD.TXT
echo bin >>FTP-CMD.TXT
echo hash >>FTP-CMD.TXT
echo prompt >>FTP-CMD.TXT
echo get sdat%DAT%.exe >>FTP-CMD.TXT
echo quit >>FTP-CMD.TXT
%comspec% /c start /wait FTP -s:FTP-CMD.TXT
FTP Command Syntax
----------------------------
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-w:buffersize Overrides the default transfer buffer size of 4096.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
-------------
The following is my TEST.BAT
If you use TEST.BAT 4423 it will download SDAT4423.exe. You can use that as the basis to in
your script to either manually feed the current revision or loop throuugh a series of
numbers represnting the latest McAfee DAT revision.
test.bat
---------
echo off
set DAT=%1
echo open ftp.nai.com >FTP-CMD.TXT
echo anonymous >>FTP-CMD.TXT
echo nospam@spam.com >>FTP-CMD.TXT
echo cd pub/antivirus/superdat/intel >>FTP-CMD.TXT
echo lcd C:\ >>FTP-CMD.TXT
echo bin >>FTP-CMD.TXT
echo hash >>FTP-CMD.TXT
echo prompt >>FTP-CMD.TXT
echo get sdat%DAT%.exe >>FTP-CMD.TXT
echo quit >>FTP-CMD.TXT
%comspec% /c start /wait FTP -s:FTP-CMD.TXT
-- Dave "Zak" <fj@somewhere.net> wrote in message news:u%23Qf6YJBFHA.3576@TK2MSFTNGP11.phx.gbl... | I'm trying to create a batch file to automatically download the sdat file | from McAfee. Is there a wildcard for ftp? | I need to have a wildcard for the "get sdat????.exe" as the ???? part of | the file name is a changing number. | | open ftp.nai.com | anonymous | nospam@spam.com | cd pub/antivirus/superdat/intel | lcd C:\ | bin | hash | prompt | get sdat????.exe | quit | | Thanks, | | Z | |
- Next message: johnfli: "add/remove programs"
- Previous message: anthonycont: "Re: I can't start Windows XP after I installed Windows 2000"
- In reply to: Zak: "Anyone know how to complete this script?"
- Next in thread: Zak: "Re: Anyone know how to complete this script?"
- Reply: Zak: "Re: Anyone know how to complete this script?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|