Advertisement
Advertisement
| 03.01.2008 at 01:49PM PST, ID: 23206697 |
|
[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: |
@ECHO OFF
REM Remove any local variables and allow for delayed expansion.
SETLOCAL ENABLEDELAYEDEXPANSION
REM Change drive and directory - you will probably want to edit this.
CD /D Z:\
REM Iterate the directory tree, executing the rest of the FOR in each directory.
FOR /R . %%A IN (.) DO (
REM Report where we are.
ECHO Examining %%A
REM Store just the name of the parent folder for later use.
SET ParentFolder="%%~nxA"
REM Initialize the file counter.
SET FileCount=0
REM Iterate the found subdirectory, counting the files and remembering the last name.
FOR %%B IN ("%%~A"\*.RPT) DO (
SET /A FileCount+=1
SET FileName="%%~B"
)
REM If only 1 file was found then rename it.
IF !FileCount! EQU 1 (
ECHO Renaming !FileName! to !ParentFolder!.RPT
REN !FileName! !ParentFolder!.RPT
)
REM If many files were found, then reset the counter and re-iterate the folder renaming as we go.
IF !FileCount! GTR 1 (
SET FileCount=0
FOR %%B IN ("%%~A"\*.RPT) DO (
SET /A FileCount+=1
ECHO Renaming "%%~B" to !ParentFolder!_!FileCount!.RPT
REN "%%~B" !ParentFolder!_!FileCount!.RPT
)
)
)
|