Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

FTP upload from .bat file (help)


  • Please log in to reply
3 replies to this topic

#1 chef423

chef423

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:05:51 AM

Posted 16 April 2014 - 06:01 PM

I hope this is the correct forum, apologies in advance if not:

 

I am attempting to upload a file from a .bat file, but I keep getting the Error reading password

 

Microsoft Windows [Version 6.1.7601]
Copyright © 2010 Microsoft Corporation.  All rights reserved.
 
C:\Users\user>C:\DWBackup\BackupDaily.bat
 
C:\Users\user>sqlcmd -S.\dinerware -Q "BACKUP DATABASE BigWater TO DISK='C:\DWBa
ckup\DWBackup.bak' WITH INIT" -oC:\DWBackup\DWBackupLog.log
 
C:\Users\user>xcopy "C:\DWBackup\DWBackup.bak" D:\DWBackup\ /E /Y
C:\DWBackup\DWBackup.bak
1 File(s) copied
 
C:\Users\user>timeout 10
 
Waiting for  9 seconds, press a key to continue ...
Connected to ftp.myftp.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 1000 allowed.
220-Local time is now 16:59. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
ftp> user USER
331 User USER OK. Password required
Error reading password.
 
530 Login authentication failed
Login failed.
ftp>
 
HERE IS THE LINE OF CODE I AM USING:
timeout 10
@echo off
ftp -n -i -s:ftpcmd.dat FTP_SERVER_ADDRESS
echo user USERNAME_REMOVED> ftpcmd.dat
echo PASSWORD_REMOVED>> ftpcmd.dat
echo cd C:\DWBackup>>ftpcmd.dat
echo bin>> ftpcmd.dat
echo put backup.bak>> ftpcmd.dat
echo quit>> ftpcmd.dat
del ftpcmd.dat
 
Ironically NONE of the 30 or so websites i have visited are any help.
 
Thank you all.

Edited by Andrew, 16 April 2014 - 06:51 PM.
Mod edit: removed FTP server address, username and password for security reasons. - AA


BC AdBot (Login to Remove)

 


#2 technonymous

technonymous

  • Members
  • 2,520 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:51 AM

Posted 16 April 2014 - 06:26 PM

http://www.howtogeek.com/50359/upload-files-to-an-ftp-site-via-a-batch-script/

 

Edit: Change your password.

 

 

Edit: I would try it like this....

 

Both bat files will need to be in the same directory to launch otherwise you will need to specify the directory in the ftp call batch IE:...
ftp -n -i -s:c:\files\script.bat

==================FTP.bat=============================

ftp -n -i -s:script.bat

==================Script.bat===============================

open domain.com
username
password
cd public_html
cd files
binary
input c:\files\*.*
bye


Edited by technonymous, 16 April 2014 - 06:54 PM.


#3 technonymous

technonymous

  • Members
  • 2,520 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:04:51 AM

Posted 16 April 2014 - 06:57 PM

Yeah I caught that too and thnx Andrew :)



#4 chef423

chef423
  • Topic Starter

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:05:51 AM

Posted 16 April 2014 - 08:28 PM

TY for removing the info I thought I had removed. Very much...

 

The 2 files are needed...hmm, i guess its the same if I am calling an ANY.sql script to run but initiated from a .bat file as well...

 

I will try, thank you so very much. 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users