Code
1rem 读取配置文件
2Dim config
3config = "conf.txt"
4set fso=createobject("scripting.filesystemobject")
5set a=createobject("scripting.dictionary")
6set file=fso.opentextfile(config)
7do while file.atendofstream<>true
8 m=m+1
9 a.add m,file.readline
10 src = a(m)
11 RenameSubPage src
12loop
13file.close
14Set fso =Nothing
15msgbox "操作已完成" ,4096,"文件重命名"
16
17Sub RenameSubPage(strURL)
18 Dim path
19 For i=19 To 100
20 path = Replace(strURL , ".html", "_"& i & ".html")
21 If fso.fileexists(path) =True Then
22 target = path & ".tmp"
23 fso.movefile path , target
24 Else
25 ' do nothing
26 End If
27 Next
28End Sub
29
1rem 读取配置文件
2Dim config
3config = "conf.txt"
4set fso=createobject("scripting.filesystemobject")
5set a=createobject("scripting.dictionary")
6set file=fso.opentextfile(config)
7do while file.atendofstream<>true
8 m=m+1
9 a.add m,file.readline
10 src = a(m)
11 RenameSubPage src
12loop
13file.close
14Set fso =Nothing
15msgbox "操作已完成" ,4096,"文件重命名"
16
17Sub RenameSubPage(strURL)
18 Dim path
19 For i=19 To 100
20 path = Replace(strURL , ".html", "_"& i & ".html")
21 If fso.fileexists(path) =True Then
22 target = path & ".tmp"
23 fso.movefile path , target
24 Else
25 ' do nothing
26 End If
27 Next
28End Sub
29
注释: conf.txt 文件内容如下:
D:\a\b\c.html
D:\d\e\f.html