|
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFolder = objFSO.GetFolder("R:\")
- Function Lpad(strInput, length, character)
- Lpad = Right(String(length, character) & strInput, length)
- end function
- i = 1
- For Each objFile In objFolder.Files
- If LCase(objFSO.GetExtensionName(objFile.Name)) = "jpg" Then
- strFN = "XYZ" & LPad(i, 3, "0")
- objFSO.CreateFolder strFN
- objFSO.MoveFile objFile.Name, strFN & "\" & objFile.Name
- i = i + 1
- End If
- Next
複製代碼 |
|