Where do I put that? I know little about Batch files someone helped me with this code.
Main Topics
Browse All Topics
Here is the Batch file for the FTP:
Called - BATCH-FTP_SCATDB_DATA.bat
@echo off
(echo open ??.??.??.??
echo user MyUser
echo MyPassword
echo cd /Backup_DataFolder
echo bin
echo put "C:\Users\Public\ServerDat
echo quit
) | ftp -n -s -i
When I used the Windows Task Scheduler I put in this:
Action: Start a Program
Program/Script: ftp
Add Arguments: -n -s:"C:\Users\BatchFolder\D
I have checked with my Hosting provider and they say I have access. I can use Filezilla and upload the files from the same server directly to the FTP site manually with no problem. It seems to show something under Permissions when I try to upload using Windows FTP Under
Filezilla it says Owner/Group "ftp/ftp" the permissions said rw-r-r. I do not know if that is an issue or not since I can manually upload.
I did notice before I put the "-n" in this statement of the last line in the batch file " ftp -n -s -i " that the file " SRSCDataBackup.7z " did get placed in the folder but it had only 0 kb and I waited 15 minutes to see if it had fully uploaded. It did not. Any help you could provide is much appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Also I noticed that when I go to the Batch file and I right on the Batch file I notice the cmd.exe window pops up and inside the black window the word "Password:_" comes up. The cursor is not blinking. I also try to type in a password that I believe to be relevant and nothing happens. No characters move the cursor or show asterisk. Any thoughts as to why that is happening?
Still not working. Farhankazi You can see from the question that the last line for me is
Echo QUIT
ftp -n -s -i
You have this:
ECHO QUIT)>Config.ftp
FTP -s:Config.ftp
I don't have what you have. Can you clarify the config.ftp with an example.
When I click Run on the task it shows that it runs with no errors within a few seconds. The actuall upload manually takes at least 3 minutes not 3 seconds. Wwhen I go to the FTP to verify the file is not there. Do you see any problems with my code?
I am unable to run your mentioned script from command line. It gives FTP command help instead of transferring file.
Did you try to run my script from command line?
Please try again by replacing following line:
ECHO CD /Backup_DataFolder
with
ECHO CD Backup_DataFolder/
If it works from command line, then run through scheduled tasks and post the "Result Code" and Log file. (Scheduled Tasks -> Advanced -> View Log).
I tried the ECHO CD Backup_DataFolder/ change.
I ran the Task and it ran very quickly. It should take at least 3-4 minutes. Here is the screen shot. let me know if you need more.
Also could a space between the characters in the folder "Batch Folder\" make a difference?
Action: Start a Program
Program/Script: ftp
Add Arguments: -n -s:"C:\Users\Batch Folder\Documents\BATCH-FTP
Jus
here are the results.
You should not use a CMD/batch script as input for FTP. That does not make any sense. The batch file itself calls the FTP command. The task is hence
I made exactly those changes.
I am not getting any results from the batch file. I can with Filezilla manually.
for the cmd.exe do I need to full path in that as well?
Also does that mean I do not use the " -s " anywhere in anything?
We are trying to do a nightly backup rewriting over the database from the night before.
Here is the latest result set. It looks like it is starting but nothing is getting uploaded. I am baffled? Any thoughts?
When you view your Scheduled Tasks, use the Explorer to do so, and go into the last menu of Explorer. There is a menu item for the log file. Have a look at that - it should reveal more details.
The log file is written circular, that is you have to search for a ====== line, which marks the "end of file" position.
You might need to add the complete path for cmd.exe (%Systemroot%\system32\cmd
For testing, you should allow the task to act interactively (that is, it should run with your account while you are logged in). And you should add a
pause
at the very end of the batch file (after ftp call).
About -s: Yes, the way the FTP commands are provided you do not need any -s.
I am to the point where I may need to take this offline and hire someone to get this to work. I can pay if someone can troubleshoot this. I have tried everything you have asked to the best of my knowledge.
I do not know how to add a pause in the Batch file. Something is just not working and you have all the code I am using. The Task stays hung in the Running position and nothing happens. Unless you think that the pause will do the trick after the FTP call (which I do not even know where that is). I have everything in this thread in place. I did put in the full file path on cmd.exe. I also there is no ====== line anywhere to be found.
The only thing I did not get an answer on was whether the space between my name in the folder \Rob Burdine\ would make a difference in the Action section. I changed it to a new folder with no space but there was not a difference. I have tried so many things and I have. I have all but given up. Please advise me of my options I am just about out of them.
A ha I think I am on to something. Finally can you help me with this. Before I was getting the prompt below when I simply clicked on the batch file and get the cmd.exe with the word password in it and a non-blinking cursor.
I typed in my user password and the black screen went away and dissapeared. The file got uploaded to the FTP site but it had a file size of Zero. So what does that mean? That I have to put some kind of extra code that puts in my user login password for Windows 2008 Server in that little command window you see below.
Okay once again I am confused.
DO I use "echo Bin" or "echo Binary"
Earlier you told me to switch to "echo cd Backup_SunRiver/
Now it is back to "echo cd /Backup_SunRiver
Which is it ?
echo user MyUser
echo MyPassword
Now its "echo user myuser mypassword "..................you want that right together correct ? Just a space between them. Right?
I hate to say it but it did not work. I am posting the response to this problem that the Hosting provider said may be the problem. I do not know if that is true or not but I thought I would put it past you guys.
The site I am uploading to is a Linux box. However I can upload with Filezilla with no problem. They say:
Hello Rob,
The issue is that batch files are a Windows convention, and while it is possible to run them on a Linux machine, all of the commands used in the .bat file must be Linux commands.
@echo off
(echo open ??.??.??.??
echo user MyUser MyPassword
echo cd /Backup_SunRiver
echo bin
echo put "C:\Users\Public\ServerDat
echo quit
) | ftp -n -s -i
In the above script, only cd, quit, and ftp are valid commands in RedHad Linux. You may want to consider using a bash script instead. Below are some resources on bash scripting:
http://en.wikipedia.org/wi
http://www.linuxconfig.org
http://tldp.org/LDP/abs/ht
I called them back got a different technician and he said that the guy who gave me this answer was wrong. What do you think? Remember I am sending this up from a Windows 2008 Server's Task Scheduler to at box that does happen to be a Linux box but I do not see how that would make a difference just to transfer the zipped file up via FTP? This thing just gets more interesting by the day........? !
The Hosting provider acknowledged that they were mistaken. However they checked the code and said this:
This is a 'local' issue for you and you would need to continue troubleshooting it as such. We have verified that the FTP server on our end is configured correctly and is working as expected. While your code may be valid, since this is on your server in an environment we are not familiar with there is little else we can do to assist in this regard.
Should I post my question to the Windows 2003 Server zone as there seems to not be a zone for Windows 2008 Server? I have exhausted what I know to do..
Unless there is something I could check on the Server that would stop the process from launching when clearly I can do the upload manually with Filezilla? Help Me Obi One your my only hope !
Reading that, I come to the conclusion that you do not have the slightest touch of knowledge here. I will treat you accordingly.
On you Windows server, open a CMD prompt. Type
I love it ! My friend after having 23 posts you should have realized I haven't the slightest touch of knowledge here. HA HA HA! Don't get me wrong I am eternally grateful for the help.
Here is what I did I got as far as the user name password before I hit the road bump.
I got this response after the user password. The user and password seemed to have worked. I did get the message then it seems to have gone past that and got hung up on the
"echo cd /Backup_SunRiver"
331 Please specify the password.
230 Login successful.
ftp> echo cd /Backup_SunRiver
Invalid command.
ftp> echo cd /Backup_SunRiver
Invalid command.
ftp> echo cd /BackupSunRiver
Invalid command.
ftp>
I took out the " _ " underscore thinking it might be that. So far that is as far as I got. Any thoughts?
Ehem. Remove the echo from each line when you type it yourself in FTP. The echo is used in the batch file, to print out the FTP command. The command itself consist of the part after echo. Hence you type:
I looked up the PASV problem. One said it may be the Firewall. So I turned it off to make sure and that did not do it.
Another said to try typing Passive or PASV after the ftp> so ftp> passive or ftp> PASV and I got back an invalid command? I think we are getting close here must be something simple?
I just turned on the "Show Blocked Programs" in Windows Firewall and tried running the process again. And low and behold I get a Windows Security Alert "Windows has blocked ftp.exe.
I am assuming I need to go to Windows Firewall and "Add Program" set the ftp.exe and make that an exception. I was under the impression that when FTP Server was checked under exceptions that that was the ftp.exe program being allowed access.
Yes that was it. You guys verified that everything was working and helped me elliviate several problems with the code getting hung up which I had no clue. Then when I started looking for blocked programs and removed all the virus ware and firewalls noted that Windows Firewall had FTP server allowed. I thought that was the FTP.EXE I could not tell by looking at the properties. Once I added the file everything worked well. Thank you very much.
Business Accounts
Answer for Membership
by: wallyvanPosted on 2009-10-27 at 05:25:24ID: 25671573
try to switch to binary mode.
Add the following line :
echo binary