Computing.Net > Forums > Programming > Transfer a folder using FTP batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Transfer a folder using FTP batch

Reply to Message Icon

Name: Rocky5
Date: July 17, 2007 at 19:39:32 Pacific
OS: XP PRO SP2
CPU/Ram: 512MB
Product: Custom Built
Comment:

Hi everyone i need some help please i have made this ftp script but what i want to do is transfer a folder over ftp i cant seem to get it to work it will transfer anything else apart from a folder.

username
password
cd /e/dashboard/xTV/Skin/
bin
hash
ascii
mput Amped
bye



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 17, 2007 at 21:28:24 Pacific
Reply:

That is correct; you cannot transfer a directory from the command line FTP. You must do it manually. I.E.:
mdir Amped
cd Amped
mput *

for each and every directory you wish to copy.


0

Response Number 2
Name: ghostdog
Date: July 18, 2007 at 03:33:45 Pacific
Reply:

another way is to use tools like tar to combine the files in the directory to one single file. then you can ftp this whole file


0

Response Number 3
Name: Rocky5
Date: July 18, 2007 at 07:21:57 Pacific
Reply:

the batch i made it to build a SVN skin for Xbox media center then ftp the output skin folder over to the xbox but all skins have different sub folders ie. amped/fonts/*ttf where as xTV is xTV/fonts/newfont/*ttf.

Is it not possible to creat a log file with all dir's listed in this txt file and then the ftp send each file over because each folder is different here is a list of the files in the folder.

C:\Documents and Settings\Administrator\Desktop\amped\1080i
C:\Documents and Settings\Administrator\Desktop\amped\720p
C:\Documents and Settings\Administrator\Desktop\amped\Amped_ReadMe.txt
C:\Documents and Settings\Administrator\Desktop\amped\fonts
C:\Documents and Settings\Administrator\Desktop\amped\media
C:\Documents and Settings\Administrator\Desktop\amped\NTSC
C:\Documents and Settings\Administrator\Desktop\amped\NTSC16x9
C:\Documents and Settings\Administrator\Desktop\amped\PAL
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9
C:\Documents and Settings\Administrator\Desktop\amped\skin.xml
C:\Documents and Settings\Administrator\Desktop\amped\sounds
C:\Documents and Settings\Administrator\Desktop\amped\1080i\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\720p\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDM2L__.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LEDREALI.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LED_REAL.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LED_REAL.TXT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\TCM.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDM2B__.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDM2N__.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDM2U__.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDMB___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDML___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDMN___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LCDMU___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\LICENSE.TXT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDMonoWinTT\README.TXT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD-BOLD.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD-L___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD-N___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD-U___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD2B___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD2L___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD2N___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LCD2U___.TTF
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\LICENSE.TXT
C:\Documents and Settings\Administrator\Desktop\amped\fonts\LCDWinTT\README.TXT
C:\Documents and Settings\Administrator\Desktop\amped\media\textures.xpr
C:\Documents and Settings\Administrator\Desktop\amped\NTSC\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\NTSC16x9\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\CommonViews.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\custom_SkinSetting_1112.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Defaults.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogAlbumInfo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogButtonMenu.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogContentSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogContextMenu.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogFavourites.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogFileStacking.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\dialogGamepad.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogHost.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogInvite.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogKaiToast.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogKeyboard.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogMediaSource.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogMusicScan.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogMuteBug.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogNetworkSetup.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\dialogNumeric.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogOK.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogProgress.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogScriptInfo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogSeekBar.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogSelect.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogSubMenu.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogVideoInfo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogVolumeBar.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\DialogYesNo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\FileBrowser.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\FileManager.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Home.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Home.xml.bak
C:\Documents and Settings\Administrator\Desktop\amped\PAL\includes.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\LockSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\LoginScreen.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MusicOSD.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MusicOSDVisSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MusicOverlay.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MusicVisualisation.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyBuddies.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyGameSaves.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyMusicNav.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyMusicPlaylist.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyMusicPlaylistEditor.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyMusicSongs.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyPics.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyPrograms.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyScripts.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyVideo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyVideoNav.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyVideoPlaylist.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\MyWeather.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\PlayerControls.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Pointer.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\ProfileSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Settings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SettingsCategory.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SettingsProfile.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SettingsScreenCalibration.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SettingsSystemInfo.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SettingsUICalibration.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\SlideShow.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Startup.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\TrainerSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\Translate.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VideoFullScreen.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VideoOSD.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VideoOSDBookmarks.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VideoOSDSettings.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VideoOverlay.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL\VisualisationPresetList.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\CommonViews.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\CommonViews.xml2
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\Font.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\Home.xml
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\Home.xml2
C:\Documents and Settings\Administrator\Desktop\amped\PAL16x9\includes.xml
C:\Documents and Settings\Administrator\Desktop\amped\sounds\back.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\click.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\cursor.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\notify.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\out.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\shutter.wav
C:\Documents and Settings\Administrator\Desktop\amped\sounds\sounds.xml
C:\Documents and Settings\Administrator\Desktop\amped\sounds\start.wav



0

Response Number 4
Name: Razor2.3
Date: July 18, 2007 at 07:56:07 Pacific
Reply:

It's possible, and I might throw something up when I wake up, but it'd be much easier to get some GUI FTP (like FileZilla) and use that.


0

Response Number 5
Name: Mechanix2Go
Date: July 18, 2007 at 08:02:07 Pacific
Reply:

I think you need to CD to each directory in turn [on client and server] and mput one dir at a time.


=====================================
If at first you don't succeed, you're about average.

M2



0

Related Posts

See More



Response Number 6
Name: Rocky5
Date: July 18, 2007 at 08:31:11 Pacific
Reply:

Thank you here is the batch file i have made so that you can see what iam trying to do.

removed


0

Response Number 7
Name: Mechanix2Go
Date: July 18, 2007 at 09:09:04 Pacific
Reply:

I'm going through it now.

Is it working?



=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 8
Name: Rocky5
Date: July 18, 2007 at 11:01:40 Pacific
Reply:

Here is the new batch file with the skin folder so that you can see how the batch works and test it.

Download
http://www.sendspace.com/file/in8cua


0

Response Number 9
Name: Mechanix2Go
Date: July 18, 2007 at 11:50:06 Pacific
Reply:

That rar is 11MB LOL.

I'm not going to replicate the directory structure and then to to figure out what the BAT is trying to do.

It's over to you to say what's working and what isn't.

BTW, some of your code can be simplified.

This:

Set /p choice= [Y,N]=
If '%choice%'=='y' goto setup
If '%choice%'=='n' goto skinsetup
If '%choice%'=='Y' goto setup
If '%choice%'=='N' goto skinsetup

can be:

choice & goto :!errorlevel!



=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 10
Name: Rocky5
Date: July 18, 2007 at 12:14:16 Pacific
Reply:

the only thing that is not working is the transfer of a folder using command FTP

the batch works fine its just i want to transfer the output folder to the xbox once it has been created but i cant do that.

it doesnt recognize the folder.

this is y i asked if you can use a log.txt file to list all the files in all the subfolders then transfer them using the log file as a template or guide.


0

Response Number 11
Name: Mechanix2Go
Date: July 18, 2007 at 12:44:33 Pacific
Reply:

In your ftp script maker, you will probably need lines like these:

@echo off

>> #.ftp echo ! cd c:\files
>> #.ftp echo cd /files
>> #.ftp mput *.*
>> #.ftp echo ! cd c:\util
>> #.ftp echo cd /util
>> #.ftp mput *.*

=================
So it changes DIRs on client and server and send the files.


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 12
Name: Razor2.3
Date: July 18, 2007 at 15:13:24 Pacific
Reply:

Actually,he'll need to do use lcd, as !cd would start a new shell, run the cd command, then exit.


0

Response Number 13
Name: Mechanix2Go
Date: July 18, 2007 at 16:29:13 Pacific
Reply:

AHA!

Thanks Razor2.3


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 14
Name: Rocky5
Date: July 18, 2007 at 18:54:37 Pacific
Reply:

am sorry but you guys have compleatly lost me sorry could you do an example of my ftp code using your new ftp code so that i know how to set it up please.


0

Response Number 15
Name: Mechanix2Go
Date: July 21, 2007 at 04:16:02 Pacific
Reply:

You need a section or subroutine like this to create and run an ftp script.

In this example the two directories are uril and files.

=======================================
@echo off

> #.ftp echo o mydomain
>> #.ftp echo username
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo prompt
>> #.ftp echo lcd c:\files
>> #.ftp echo cd /files
>> #.ftp echo mput *.*
>> #.ftp echo lcd c:\util
>> #.ftp echo cd /util
>> #.ftp echo mput *.*
>> #.ftp echo bye

ftp -s:#.ftp
===========================


=====================================
If at first you don't succeed, you're about average.

M2



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Transfer a folder using FTP batch

Move a folder using .VBS www.computing.net/answers/programming/move-a-folder-using-vbs/17394.html

opening a folder www.computing.net/answers/programming/opening-a-folder-/14718.html

FTP DOS Batch File www.computing.net/answers/programming/ftp-dos-batch-file/15347.html