windows批处理,怎么从多个文件夹中取文件

intheair_2008 2010-05-29 03:09:41
我要在windows上建批处理,从linux上通过ftp下载www文件夹下的图片xxx.jpg
有两个目录:
/home/www/xxx.jpg 这个可以写出来
/home/spid/www/xxx.jpg 这个由于spid是变化的,所以不会循环取,请高手指教
例如:

/home/1001/www/001.jpg
/home/1001/www/002.jpg
/home/1002/www/003.jpg
/home/1002/www/003.jpg
.
.
.

谢谢!
...全文
212 8 打赏 收藏 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
intheair_2008 2010-06-02
  • 打赏
  • 举报
回复
搞定了,谢谢各位
intheair_2008 2010-06-01
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 ljc007 的回复:]
引用/home/www/xxx.jpg 这个可以写出来

先把你写的贴出来看看吧
[/Quote]

----循环可以实现的
@echo off
set ftpIP=10.138.53.37
set ftpFolder=D:\DLSCReport
set LocalFolder=D:\wangdemin\Icon
set ftpFile=%LocalFolder%\TempFTP.bat
>"%ftpFile%" (
echo dlsc
echo dlsc
echo cd "%ftpFolder%"
echo lcd "%LocalFolder%"
echo bin
for /l %%i in (1,1,9) do (
echo cd 200%%i\wap
echo mget *
echo cd \
)
echo bye
)
start ftp -v -i -s:"%ftpFile%" %ftpIP%


------怎么放到一文本文件中?怎么读取读取,这个代码怎么写?麻烦帮我继续啊,谢谢啦~结贴给分。。
intheair_2008 2010-06-01
  • 打赏
  • 举报
回复
循环不靠谱spid都是6位数的,spid一共才300多,如果能遍历就好了。。
ljc007 2010-06-01
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 intheair_2008 的回复:]
------怎么放到一文本文件中?怎么读取读取,这个代码怎么写?
[/Quote]

你不是自己写出来了么?
放到文件中干吗?
ljc007 2010-05-31
  • 打赏
  • 举报
回复
引用
/home/www/xxx.jpg 这个可以写出来


先把你写的贴出来看看吧
intheair_2008 2010-05-31
  • 打赏
  • 举报
回复
如果就让spid从1000循环到9999,中间没有的文件夹会不会报错?
请给出取批处理命令。。谢啦
就是just4 2010-05-31
  • 打赏
  • 举报
回复
"/home/spid/www/xxx.jpg 这个由于spid是变化的,所以不会循环取"

这要看这个spid是否有规律,

1.有规律的话,比如:test001 test002 ...
[code=BatchFile]for /l %i in (1,1,9) do echo test00%i
for /l %i in (10,1,99) do echo test0%i[/code]

2.没有规律的话,直接放到一文本文件中读取即可:
[code=BatchFile]for /f "delims=" %i in (c:\test.txt) do echo %i[/code]
ljc007 2010-05-30
  • 打赏
  • 举报
回复
从1001开始,到哪个数字结束?

6,873

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧