标题: 管理 学生上传到FTP里的东西!可是出现错误!!
[打印本页]
作者: zxzx5200
时间: 2008-3-5 12:09
标题: 管理 学生上传到FTP里的东西!可是出现错误!!
@echo off
@if exist aa1.txt del /f /q aa1.txt>nul
set /p sh=请输入你要察看的目录(绝对路径 例如 d:\ftp\):
set /p file=请输入你要查看的文件扩展名(例如 exe):
for /r %sh% %%a in (*.%file%) do echo %%a>>aa1.txt
echo 列表正在输出中...
echo 正在为您打开中...
echo.
echo.
echo 如果你发现 某个 不想删除的文件!
echo .
echo .
echo 请把它的 绝对路径 从即将 未您打 开的.txt中删除掉!
echo .
echo .
echo 已经为您准备好!
echo .
echo .
echo 为您打开中...
echo .
pause
start /max aa1.txt
set /p dd=如果要删除那个-文本文件-剩下的内容 -请输入del确认:
if %dd%==del goto forr else exit
:forr
for /f "delims=%file%" %%a in (aa1.txt) do echo del /f /s %%a%file%>>b.txt
ren b.txt bel.bat
start /min bel.bat
ping /n 1 1 >nul
exit
------------------------
为什么这个批处理
执行 错误
这个是有的路径!
d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxm\sdpt-tcor-cd1.rmvb
d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxm\sdpt-tcor-cd2.rmvb
d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxm\sdpt-tcor-cd3.rmvb
当它到 b.txt 里就变成了!
del /f /s d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxrmvb
del /f /s d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxrmvb
del /f /s d:\ftp\15\0张旭\天域战时@猪猪乐园@Liuxrmvb
然后 做 del 命令就错误了!
我就郁闷了!
我做这个批处理原本是为了管理 学生上传到FTP里的东西!
有学生上传电影!游戏 等等做及时处理!
有更好的方法欢迎指教
QQ:250900475
在线!!
作者: HAT
时间: 2008-3-5 14:43
for /f "delims=%file%" %%a in (aa1.txt) do echo del /f /s %%a%file%>>b.txt
=====================
不应该用文件的扩展名作为分割字符
for命令的帮助里面有这样一段:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do @echo %i %j %k
would parse each line in myfile.txt, ignoring lines that begin with
a semicolon, passing the 2nd and 3rd token from each line to the for
body, with tokens delimited by commas and/or spaces. Notice the for
body statements reference %i to get the 2nd token, %j to get the
3rd token, and %k to get all remaining tokens after the 3rd. For
file names that contain spaces, you need to quote the filenames with
double quotes. In order to use double quotes in this manner, you also
need to use the usebackq option, otherwise the double quotes will be
interpreted as defining a literal string to parse.
作者: tt518
时间: 2008-4-1 21:38
那么如何解决了?