本文主要是介绍vbs批量修改文件名,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Dim sFolders, Ext, message, filename
sFolder = "D:\图片库\随机样本"
Dim fs, oFolder, oFiles, oSubFolders
set fs = CreateObject("Scripting.FileSystemObject")
set oFolder = fs.GetFolder(sFolder) '获取文件夹
set oFiles = oFolder.Files '获取文件集合
index = 1
for each strFile in oFilesstrNewName = "a_" & index & ".jpg" fs.MoveFile strFile, sFolder & "\" & strNewName index = index + 1
Next
index = 1
for each strFile in oFilesstrNewName = index & ".jpg" fs.MoveFile strFile, sFolder & "\" & strNewName index = index + 1
Next
这篇关于vbs批量修改文件名的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!