1
rem 读取配置文件2
Dim config 3
config = "conf.txt"4
set fso=createobject("scripting.filesystemobject") 5
set a=createobject("scripting.dictionary") 6
set file=fso.opentextfile(config) 7
do while file.atendofstream<>true 8
m=m+1 9
a.add m,file.readline 10
src = a(m)11
RenameSubPage src12
loop 13
file.close 14
Set fso =Nothing 15
msgbox "操作已完成" ,4096,"文件重命名"16

17
Sub RenameSubPage(strURL)18
Dim path19
For i=19 To 10020
path = Replace(strURL , ".html", "_"& i & ".html")21
If fso.fileexists(path) =True Then 22
target = path & ".tmp"23
fso.movefile path , target24
Else 25
' do nothing 26
End If 27
Next 28
End Sub 29

注释: conf.txt 文件内容如下:
D:\a\b\c.html
D:\d\e\f.html