• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

auto ftp and vbs script

Hello there, i was wondering if anybody could help me out with the following, i am looking for a vb script that will auto ftp all mp3 in a folder and then purge the files after it has ftp'd them?

thanks
0
jonathanduane2010
Asked:
jonathanduane2010
1 Solution
 
Ron MalmsteadInformation Services ManagerCommented:
Use FTPCMD.exe


http://support.microsoft.com/kb/238273


...then simply clear the folder...

DEL c:\yourfolder\*.mp3 /Q
0
 
Ron MalmsteadInformation Services ManagerCommented:
Nevermind...I thought that was a link to a utility I used a while ago.

Different link.
0
 
Bill PrewCommented:
If you want to stick with the core FTP utility in Windows, then something like this should work:

@echo off

pushd "C:\MP3"

REM Do FTP transfer
(
echo open hostname
echo username
echo password
echo mput *.mp3
echo bye
)|ftp

REM Delete MP3 files
del /Q *.mp3

popd

Open in new window

But personally I would use a more robust tool like NCFTPPUT, which can do the xfer and aslo delete the files after a successful transfer, all from a single command line.  Check it out at:

http://www.ncftp.com/ncftp/

~bp
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jonathanduane2010Author Commented:
ok i have tried that and it deletes the file but doesnt actually upload the file

i have this at the moment

@echo off

pushd "C:\MP3"

REM Do FTP transfer
(
echo open 213.146.144.194/news/jonathan
echo username
echo password
echo mput *.mp3
echo bye
)|ftp

REM Delete MP3 files
del /Q *.mp3

popd
0
 
AlexPaceCommented:
This Robo-FTP script uploads all mp3 files in the folder and deletes files after upload but only if the upload was successful:
WORKINGDIR "c:\mp3"     ;; Local folder
FTPLOGON "211.116.164.175" /user="username" /pw="secret"
FTPCD "/news/jonathan"  ;; Remote folder
SENDFILE "*.mp3" /delete
FTPLOGOFF
EXIT

Open in new window

0
 
Bill PrewCommented:
Do you get any errors to the screen from the FTP xfer.

~bp
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now