想做一个程序,能够改变所有文件名,但是格式不变
只是在原来的文件名前面加一串数字
例如:把001变成002001,
      002... 002002,
      .............
请问怎么做

解决方案 »

  1.   

    1.获取所有的文件列表
    2.循环给每个文件重命名
    3.OKFOR K=1 TO 文件总数
        name 原文件名 as format(k,"000") & 原文件名
    next
    '=============================
    红松软件论坛  zbhssoft.5d6d.com
      

  2.   

    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
    给我看看对不对
    原文件名应该怎么怎么表达呢?
      

  3.   

    把原文件名改成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+原文件名
    而且每次只能改一个,多选会报错,然后自动关闭程序高手帮忙解决啊