Link to home
Start Free TrialLog in
Avatar of jonathanduane2010
jonathanduane2010

asked on

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
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Use FTPCMD.exe


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


...then simply clear the folder...

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

Different link.
Avatar of Bill Prew
Bill Prew

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
Avatar of jonathanduane2010

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of AlexPace
AlexPace
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you get any errors to the screen from the FTP xfer.

~bp