"Jake" <> wrote in message
news:%...
> Pegasus [MVP] skrev:
>> Let's have a look at your script that did not quite work!
>
> In the file ftpscriptfull-1.txt below I have tried various options:
> C:\DirWithSubfolders
> C:\DirWithSubfolders\
> C:\DirWithSubfolders\*.*
>
> Contents of file ftpscriptfull-1.txt:
>
> user moses <passwrd>
> mput C:\DirWithSubfolders
> bye
>
> Contents of actual batch file:
>
> ftp -n -s:c:\bogus\ftpscriptfull-1.txt 192.168.100.13
> echo Full file copy completed at %time% - %date% >> C:\bogus\log.txt
>
> I want to copy C:\DirWithSubfolders with all its files and subfolders.
>
> regards jake
Ftp.exe is a fairly primitive program. To compensate for its lack of
sophistication, you have to add some intelligence to the batch file that
invokes it, e.g. like so:
@echo off
set Source=d\Friday
if not %Source:~1,2%==:\ (
echo You must specify a fully qualified source folder, e.g. D:\My Files
pause
goto :eof
)
call :Sub %Source%
for /F "delims=" %%a in ('dir "%Source%" /ad /b /s') do call :Sub %%a
goto :eof
:Sub
set Folder=%*
set Folder=%Folder:~3%
set Folder=%Folder:\=/%
echo Copying files from "%*" to "%Folder%"
set script=c:\script.scr
set site=www.MySite.com
set account=JakeKlefbeck
set password=Lisa
echo> %script% %account%
echo>>%script% %password%
echo>>%script% binary
echo>>%script% prompt off
echo>>%script% cd usr/home/jake
echo>>%script% mkdir "%Folder%"
echo>>%script% cd "%Folder%"
echo>>%script% mput "%*\*.*"
echo>>%script% quit
ftp -s:%script% %site%
del %script%
|