1.获取所有的文件列表 2.循环给每个文件重命名 3.OKFOR K=1 TO 文件总数 name 原文件名 as format(k,"000") & 原文件名 next '============================= 红松软件论坛 zbhssoft.5d6d.com
Private Sub Form_Load() File1.Pattern = "*.txt" End Sub Private Sub Dir1_Click() File1.Path = Dir1.Path End SubPrivate Sub Drive1_Change() Dir1.Path = Drive1.Drive End SubPrivate Sub Command1_Click() Sum = File1.ListCount For k = 1 To Sum Name 原文件名 As Format(k, "000 ") & 原文件名 Next End Sub 给我看看对不对 原文件名应该怎么怎么表达呢?
把原文件名改成file1后每次只能改一个文件名啊,而且不能改成自己想要的 例如 (1) Name file1 As Format(k, "000 ") & file1 运行后是001+原文件名 (2) Name file1 As Format(k, "001 ") & file1 运行后是011+原文件名 (3) Name file1 As Format(k, "002 ") & file1 运行后是012+原文件名 而且每次只能改一个,多选会报错,然后自动关闭程序高手帮忙解决啊
2.循环给每个文件重命名
3.OKFOR K=1 TO 文件总数
name 原文件名 as format(k,"000") & 原文件名
next
'=============================
红松软件论坛 zbhssoft.5d6d.com
File1.Pattern = "*.txt"
End Sub
Private Sub Dir1_Click()
File1.Path = Dir1.Path
End SubPrivate Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End SubPrivate Sub Command1_Click()
Sum = File1.ListCount
For k = 1 To Sum
Name 原文件名 As Format(k, "000 ") & 原文件名
Next
End Sub
给我看看对不对
原文件名应该怎么怎么表达呢?
例如 (1) Name file1 As Format(k, "000 ") & file1
运行后是001+原文件名
(2) Name file1 As Format(k, "001 ") & file1
运行后是011+原文件名
(3)
Name file1 As Format(k, "002 ") & file1
运行后是012+原文件名
而且每次只能改一个,多选会报错,然后自动关闭程序高手帮忙解决啊