Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim num, count, oldName, newName
- Dim max,min, strNum
- Dim arr
- Randomize
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- objStartFolder = "G:\"
- Set objFolder = objFSO.GetFolder(objStartFolder)
- Set colFiles = objFolder.Files
- count = objFolder.Files.Count
- max = count + 1000
- min = 1
- For Each objFile in colFiles
- num = GimmeRnd(max, min, strNum)
- 'msgbox(num)
- strNum = strNum + Cstr(num) + ","
- oldName = objFile.Name
- newName = Cstr(num) + "_RML_" + oldName
- objFile.Name = newName
- Next
- msgBox(strNum)
- function GimmeRnd(fMax, fMmin, fStrNum)
- dim num
- num = Int((fMax - fMin + 1) * Rnd + fMin)
- if (inStr(fStrNum, num) > 0) then
- GimmeRnd = GimmeRnd(fMax, fMin, fStrNum)
- else GimmeRnd = num
- end if
- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement