Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '==============================================================================
- '
- ' NAME: AssetDirGenerator.vbs
- '
- ' SITE : HTTP://ITTECHLOG.WORDPRESS.COM
- '
- ' COMMENT: This script creates a unique 8.3 folder.
- '==============================================================================
- Option Explicit
- Dim AantalChar, AssetDrive, intRandom, teller, strFolder, ObjFSO, objFolder, Result
- AantalChar = 8
- AssetDrive = "Q:\"
- Randomize Timer
- For teller = 1 to AantalChar step 1
- GetRandomChar
- strFolder = strFolder & chr(intRandom)
- Next
- Set ObjFSO = CreateObject("Scripting.FileSystemObject")
- IF objFSO.FolderExists(AssetDrive) Then
- Set objFolder = objFSO.CreateFolder(AssetDrive & strFolder)
- END IF
- Result = InputBox("Folder " & AssetDrive & strFolder & " gemaakt." ,"Random AssetDir generator",AssetDrive & strFolder)
- Sub GetRandomChar
- intRandom = Fix(rnd * 42) + 48
- If intRandom > 57 and intRandom < 65 then GetRandomChar
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement