有一段脚本,只能看懂一点点,上网查有些说的不明不白,求翻译一下
程序代码:
@echo off set b=%data:~0,4%%data:~5,2%%data:~8,2% setlocal enabledelayedexpansion for /d %%i in (源路径) do ( set n=%%i set name=%%~ni set a!=name! set d=%%~fi set c=!a:~0,8! if "!c!"=="%b%" ( set DataPath=!n!\ set DestPath=D:\TEST\ set DataExt=*.文件格式 set w=\文件格式\ set rar=rar.exe set rarname=!a!.rar set ftpserver=地址 set user=用户名 set pass=密码 set ftppath=目的路径 set Ftp=目的路径/!a! @echo open !ftpserver!>ftpcmd3 @echo !user!>>ftpcmd3 @echo !pass!>>ftpcmd3 @echo prompt>>ftpcmd3 @echo cd !ftppath!>>ftpcmd3 @echo mkdir !a! >>ftpcmd3 @echo bye>>ftpcmd3 ftp -s:ftpcmd3>nul del /f ftpcmd3 echo !d!!w!!DataExt! for /f %%i in ('dir /b /A-D /s !d!!w!!DataExt!') do ( set src=%%i set dest=%%~ni set e=!src! echo !Ftp! echo uploading !dest! to !ftpserver!...... ::下面这是数字1,不是字母l @echo open !ftpserver!>ftpcmd13 @echo !user!>>ftpcmd13 @echo !pass!>>ftpcmd13 @echo prompt>>ftpcmd13 @echo cd !Ftp!>>ftpcmd13 @echo bin>>ftpcmd13 @echo bin !e!>>ftpcmd13 @echo bye>>ftpcmd13 ftp -s:ftpcmd13 >nul del /f ftpcmd13 echo uploading !rarname! to !ftpserver! OK. ) ) )