Advertisement
Advertisement
| 03.27.2008 at 12:34PM PDT, ID: 23275333 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: |
@echo off
setlocal
REM The folder containing A, B, C, etc.
set root=c:\temp\temp\test
pushd "%root%"
for /F "tokens=*" %%a in ('dir /A:D /B 2^>NUL') do (
pushd "%%a"
for /F "tokens=*" %%b in ('dir /A:D /B 2^>NUL') do call :PROCESS "%%b" "%%a"
popd
)
popd
pause
goto :EOF
:PROCESS
set workDir=%~1
set seq=
:NEXTCHAR
if "%workDir%"=="" echo Error parsing %~0&goto :EOF
if /i "%workDir:~-1,1%" LSS "0" goto STOP
if /i "%workDir:~-1,1%" GTR "9" goto STOP
set seq=%workDir:~-1,1%%seq%
set workDir=%workDir:~0,-1%
goto NEXTCHAR
:STOP
if /i 1%seq% LEQ 20 set seq=0%seq%
set workDir=%~2_%seq%
if "%workDir%"=="%~1" goto :EOF
if exist "%workDir%" echo Can not rename %~1 to %workDir%. The directory already exists&goto :EOF
ren "%~1" "%workDir%"
goto :EOF
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 03.27.2008 at 01:31PM PDT, ID: 21225453 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: |
strRootFolder = "c:\temp"
intNumberOfDigits = 3 ' You can change this number
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strRootFolder)
For Each objFolder In objFolder.SubFolders
Set objParentFolder = objFSO.GetFolder(objFolder.ParentFolder)
For i = Len(objFolder.Name) To 1 Step -1
If Not IsNumeric(Mid(objFolder.Name, i)) Then
Exit For
End If
Next
' These lines will get the folder number and pad with "0"
strNumber = int(Mid(objFolder.Name, i+1))
strNumber = Space(intNumberOfDigits-Len(strNumber)) & strNumber
strNumber = Replace(strNumber, " ", "0")
strCurFolderName = objFolder.ParentFolder & "\" & objFolder.Name
strNewFolderName = objFolder.ParentFolder & "\" & objParentFolder.Name & "_" & strNumber
' The actual "moving" of the folder to new name
objFSO.MoveFolder strCurFolderName, strNewFolderName
Next
msgbox "done"
|