autoit 发表于 2008-5-3 14:20:07

列举某盘所有文件及文件夹并写入到指定文件(AU3)

If&nbsp;FileExists(&quot;c:&#92;1.txt&quot;)&nbsp;Then&nbsp;FileDelete(&quot;c:&#92;1.txt&quot;)<br /><br />Local&nbsp;$fh&nbsp;=&nbsp;FileOpen(&quot;c:&#92;1.txt&quot;,&nbsp;2)<br />FindAll(&quot;L:&#92;bt&quot;)<br />FileClose($fh)<br /><br />Func&nbsp;FindAll($path)<br />&nbsp;Local&nbsp;$fpath,&nbsp;$fs,&nbsp;$fa<br />&nbsp;$fpath&nbsp;=&nbsp;$path&nbsp;&amp;&nbsp;&quot;&#92;*.*&quot;<br />&nbsp;Local&nbsp;$f&nbsp;=&nbsp;FileFindFirstFile($fpath)<br />&nbsp;<br />&nbsp;While&nbsp;1<br />&nbsp;&nbsp;$fs&nbsp;=&nbsp;FileFindNextFile($f)<br />&nbsp;&nbsp;If&nbsp;@error&nbsp;Then&nbsp;<br />&nbsp;&nbsp;&nbsp;FileClose($f)<br />&nbsp;&nbsp;&nbsp;Return<br />&nbsp;&nbsp;EndIf<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;If&nbsp;$fs&nbsp;=&nbsp;&quot;.&quot;&nbsp;Or&nbsp;$fs&nbsp;=&nbsp;&quot;..&quot;&nbsp;Then<br />&nbsp;&nbsp;&nbsp;ContinueLoop<br />&nbsp;&nbsp;EndIf<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;$fa&nbsp;=&nbsp;FileGetAttrib($path&nbsp;&amp;&nbsp;&quot;&#92;&quot;&nbsp;&amp;&nbsp;$fs)<br />&nbsp;&nbsp;If&nbsp;StringInStr($fa,&nbsp;&quot;D&quot;)&nbsp;Then<br />&nbsp;&nbsp;&nbsp;FindAll($path&nbsp;&amp;&nbsp;&quot;&#92;&quot;&nbsp;&amp;&nbsp;$fs)<br />&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;FileWriteLine($fh,&nbsp;$path&nbsp;&amp;&nbsp;&quot;&#92;&quot;&nbsp;&amp;&nbsp;$fs)<br />&nbsp;&nbsp;EndIf<br />&nbsp;WEnd<br />EndFunc<br /><br /><a href="http://autoit.8800.org/" target="_blank">http://autoit.8800.org/</a>&nbsp;的AMU最中解决方法&nbsp;&nbsp;简单&nbsp;&nbsp;明了&nbsp;速度<br /><br />dir/a/b/s&nbsp;d:&nbsp;&gt;&nbsp;filelist.txt<br />

星驰周 发表于 2008-5-22 20:17:26

不错,用得着,学习了,标记一下!

ceoguang 发表于 2009-1-21 14:53:47

不错,收藏了

okbak02 发表于 2009-5-10 11:23:42

:face (29)::face (29):

zzfbz 发表于 2009-5-11 21:23:48

If&nbsp;FileExists("c:&#92;1.txt")&nbsp;Then&nbsp;FileDelete("c:&#92;1.txt")Local&nbsp;$fh&nbsp;=&nbsp;FileOpen("c:&#92;1.txt",&nbsp;2)FindAll("L:&#92;bt")FileClose($fh)Func&nbsp;FindAll($path)&nbsp;L ...
autoit 发表于 2008-5-3 14:20 http://www.autoitx.com/images/common/back.gif
建议把这几句
If FileExists(@ScriptDir&'\文件列表.txt') Then FileDelete(@ScriptDir&'\文件列表.txt')
Local $fh = FileOpen(@ScriptDir&'\文件列表.txt', 2)
FindAll(@ScriptDir&'\')
修改为:
If FileExists(@ScriptDir&'\文件列表.txt') Then FileDelete(@ScriptDir&'\文件列表.txt')
Local $fh = FileOpen(@ScriptDir&'\文件列表.txt', 2)
FindAll(@ScriptDir&'\')

lynfr8 发表于 2009-5-11 21:55:21

楼上的
我怎么看你的修改为和上面都一样的啊

javarike 发表于 2009-5-19 17:03:54

不错啊.谢谢分享了

q958com 发表于 2009-5-19 17:26:04

:face (27):

q958com 发表于 2009-5-19 17:26:10

:face (22):

q958com 发表于 2009-5-19 17:26:18

:face (14):

zhenglei 发表于 2009-5-23 12:18:44

dddddddddddddddddddddddddddddddddd

pangzi_0 发表于 2009-5-27 09:38:57

新手 看的不大明白 可以吧每步的作用注释下就好啦

syhw222 发表于 2011-1-1 20:35:34

测试一下,好象是没有执行!

iClearly 发表于 2011-1-2 01:37:13

不错收藏了,感谢分享

iClearly 发表于 2011-1-2 01:37:18

不错收藏了,感谢分享
页: [1] 2
查看完整版本: 列举某盘所有文件及文件夹并写入到指定文件(AU3)