- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: Passing parameter to Ftp Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 09:14 PM
тАО01-18-2006 09:14 PM
I am automating an Ftp task.
Done mainly, just need to pass an parameter, which i am unable to do.
What i am doing is:
ftp -s:Input_file hostname
username
password
commnad
bye
In the command i want to transfer one file.
This file will be given at the command prompt while calling that Ftp_Automate.bat so that it can be a general one.
Now how do i do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 11:27 PM
тАО01-18-2006 11:27 PM
Re: Passing parameter to Ftp Script
echo put %1 | ftp -s:Input_file hostname
username
password
Then run:
Ftp_automate.bat filename_to_put
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 12:37 AM
тАО01-19-2006 12:37 AM
Re: Passing parameter to Ftp Script
I am unable to get that in place.
echo put %1 | ftp -s:Input_file hostname
username
password
Then run:
Ftp_automate.bat filename_to_put
Now where will it put the file.
I also need to do a cd, because the location is different.
Also it simpy echoes the whole line and not doing a Ftp.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 02:40 AM
тАО01-19-2006 02:40 AM
Solutionecho user username > Input_file
echo password >> Input_file
echo cd %1 >> Input_file
echo put %2 >> Input_file
echo bye >> Input_file
ftp -n -s:Input_file hostname
Then use like this:
Ftp_automate.bat directory file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 05:21 AM
тАО01-19-2006 05:21 AM
Re: Passing parameter to Ftp Script
-------------------
@echo off
rem ..: ftp_automate.bat
rem ..: Automates FTP of system files
rem ..: files needed ftp_automate.bat, Input_file
rem ..:----------------------------------
if %2!==! goto error
echo user username > Input_file
echo password >> Input_file
echo cd %1 >> Input_file
echo put %2 >> Input_file
echo bye >> Input_file
ftp -n -s:Input_file hostname
goto done
:error
echo Usage: ftp_automate directory filename
:done
rem ..:---------------------------------
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2006 07:38 PM
тАО01-22-2006 07:38 PM
Re: Passing parameter to Ftp Script
It works now.
But i think there must be a formal way of passing parameters rather than echoing :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2010 05:28 AM
тАО04-14-2010 05:28 AM
Re: Passing parameter to Ftp Script
I would like your help.
I├В┬┤m trying to automate my FTL process but every script or solution that I have seen in the WEB tells me to create a file with user and password inside.
I├В┬┤m not allowed to create a file with user and password, so I have to use a parameter to do a FTP.
I have tryed to create a bat like this:
ftp -i dsv075
%1
%2
pause
lcd %dirlcd%
cd %dircdput%
binary
prom
......
But the script ask me always the user and password without use %1 and %2.
Do you have any idea?
Thank you very much and it is urgent.
Gustavp