Computing.Net > Forums > Windows XP > FTP batch: pass in params

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

FTP batch: pass in params

Reply to Message Icon

Name: narnar2000
Date: June 14, 2004 at 09:44:58 Pacific
OS: XP Pro SP1
CPU/Ram: XP2800/1024
Comment:

Hi all,

I need to ftp a file (with a variable filename) to a remote server. I can automate this process with a constant filename, but how do I pass in a filename on the fly?

Say my batch script is called ftpbat. I want to be able to run this:

ftpbat variablefilename

Using %1 etc doesn't work once an ftp session has been opened... And if I put the ftp commands in an ancillary file, I'm unable to pass in the params from ftpbat...

Any ideas?

Thanks.




Sponsored Link
Ads by Google

Response Number 1
Name: Everett
Date: June 16, 2004 at 19:59:46 Pacific
Reply:

narnar2000: try the Programming forum.



0

Response Number 2
Name: narnar2000
Date: June 17, 2004 at 08:17:37 Pacific
Reply:

That qualifies as a programming question? Not the programming I know...


0

Response Number 3
Name: narnar2000
Date: June 18, 2004 at 03:23:45 Pacific
Reply:

I was given the answer (all credit to Jag on this one). The solution is to pipe the commands to another file first (called ftp.ftp here):

echo open ftp.somedomain.com>> ftp.ftp
echo username>> ftp.ftp
echo password>> ftp.ftp
echo bin>> ftp.ftp
echo put %1>> ftp.ftp
echo quit>> ftp.ftp
ftp -s:ftp.ftp


Thanks again to Jag for this one.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: FTP batch: pass in params

BATCH FILES IN XP? www.computing.net/answers/windows-xp/batch-files-in-xp/8304.html

Using DOS Batch File in Windows XP www.computing.net/answers/windows-xp/using-dos-batch-file-in-windows-xp/23275.html

batch file in recovery console www.computing.net/answers/windows-xp/batch-file-in-recovery-console/40057.html