We help IT Professionals succeed at work.

Related to: Suppress RD in batch - menu options?

Reference back to :
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_26248662.html

As you can see when i add the accepted code into my Menu batch , it acts weird.

is not right?

also the attached is the BIG bat file i want to eventually finalize.
 IT-ToolwoRx-v3.1a.bat.txt
@ECHO OFF
@color 0A
:MENU
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º      Choose Your Tool       º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO 1 - Windows XP (Temp Cleaner)
ECHO 2 - Windows 7 (Temp Cleaner)
ECHO.
SET /P M=Select a number, then press ENTER: 
IF %M%==1 GOTO XP
IF %M%==2 GOTO 7

:XP
CLS
@COLOR 04
@ECHO OFF
setlocal enabledelayedexpansion
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

for /F "tokens=1 delims=[]" %%N in ('find /N ":StartOfCodeXP" ^<"%~f0"') do set start=%%N
for /F %%N in ('find /C /V "" ^<"%~f0"') do set /A lines=%%N-start
set line=0
for /F "skip=%start% usebackq tokens=* delims=" %%L in ("%~f0") do (
  call %%L 2>nul >nul
  set /P j=Û< NUL
  set /A line += 1
  set /A pct= line * 100 / lines
  title !pct!^% done
)  

PAUSE>NUL
GOTO Done

:StartofCodeXP
cd %SYSTEMDrive%\
RD /s /q "%WINDIR%\Prefetch"
RD /s /q "%TEMP%"
RD /s /q "%USERPROFILE%\Local Settings\Temp"
RD /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /s /q "%USERPROFILE%\Cookies"
RD /s /q "%SystemRoot%\Downloaded Program Files"
RD /s /q "%SystemRoot%\Temp"
RD /s /q "%SystemRoot%\tmp"
RD /s /q "C:\$Recycle.bin"
REM  ---Super File Cleaner
del /f /s /q %SystemDrive%\*.log
del /f /s /q %SystemDrive%\~*.*
del /f /s /q %SystemDrive%\*.tmp
del /f /s /q %SystemDrive%\*.bak
del /f /s /q %SystemDrive%\*.old
REM  ---END of Super File Cleaner

:7
CLS
@COLOR 04
@ECHO OFF
setlocal enabledelayedexpansion
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

for /F "tokens=1 delims=[]" %%N in ('find /N ":StartOfCode7" ^<"%~f0"') do set start=%%N
for /F %%N in ('find /C /V "" ^<"%~f0"') do set /A lines=%%N-start
set line=0
for /F "skip=%start% usebackq tokens=* delims=" %%L in ("%~f0") do (
  call %%L 2>nul >nul
  set /P j=Û< NUL
  set /A line += 1
  set /A pct= line * 100 / lines
  title !pct!^% done
)  

PAUSE>NUL

GOTO Done

:StartOfCode7
cd /D %SYSTEMDrive%\
RD /s /q "%WINDIR%\Prefetch"
RD /s /q "%TEMP%"
RD /s /q "%USERPROFILE%\Local Settings\Temp"
RD /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /s /q "%USERPROFILE%\Cookies"
RD /s /q "%SystemRoot%\Downloaded Program Files"
RD /s /q "%SystemRoot%\Temp"
RD /s /q "%SystemRoot%\tmp"
RD /s /q "C:\$Recycle.bin"
REM  ---Super File Cleaner
del /f /s /q %SystemDrive%\*.log
del /f /s /q %SystemDrive%\~*.* 
del /f /s /q %SystemDrive%\*.tmp
del /f /s /q %SystemDrive%\*.bak
del /f /s /q %SystemDrive%\*.old
REM  ---END of Super File Cleaner

:Done
CLS
@COLOR 0A
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@Echo º      Your System is now Clean       º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@PAUSE
CLS
GOTO MENU

Open in new window

Comment
Watch Question

Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
Reposting from the (closed) related thread, see my code below.

But why are you using a menu, and don't differ yourself?

for /F "tokens=4,5* delims=[].^ " %%A in ('ver') do (
   rem %%A.%%B =
   rem     5.0  W2000  
   rem     5.1  XP
   rem     5.2  W2003
   rem     6.0  Vista / W2008
   rem     6.1  W7
)

And why are you using different codes for XP and W7? You need to, to account for some differences in the profile folders, but your code does not reflect that - both StartOfCodexx are the same.
@color 0A
:MENU
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º      Choose Your Tool       º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO 1 - Windows XP (Temp Cleaner)
ECHO 2 - Windows 7 (Temp Cleaner)
ECHO.
SET /P M=Select a number, then press ENTER: 
IF %M%==1 GOTO XP
IF %M%==2 GOTO 7

:XP
CLS
@COLOR 04
@ECHO OFF
setlocal enabledelayedexpansion
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

for /F "tokens=1 delims=[]" %%N in ('find /N ":StartOfCodeXP" ^<"%~f0"') do set start=%%N
for /F "tokens=1 delims=[]" %%N in ('find /N ":EndOfCodeXP"   ^<"%~f0"') do set /A lines=%%N - start
set line=0
for /F "skip=%start% usebackq tokens=* delims=" %%L in ("%~f0") do (
  call %%L 2>nul >nul
  set /P j=Û< NUL
  set /A line += 1
  set /A pct= line * 100 / lines
  title !pct!^% done
)  

GOTO Done

:StartofCodeXP
cd %SYSTEMDrive%\
RD /s /q "%WINDIR%\Prefetch"
RD /s /q "%TEMP%"
RD /s /q "%USERPROFILE%\Local Settings\Temp"
RD /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /s /q "%USERPROFILE%\Cookies"
RD /s /q "%SystemRoot%\Downloaded Program Files"
RD /s /q "%SystemRoot%\Temp"
RD /s /q "%SystemRoot%\tmp"
RD /s /q "C:\$Recycle.bin"
REM  ---Super File Cleaner
del /f /s /q %SystemDrive%\*.log
del /f /s /q %SystemDrive%\~*.*
del /f /s /q %SystemDrive%\*.tmp
del /f /s /q %SystemDrive%\*.bak
del /f /s /q %SystemDrive%\*.old
REM  ---END of Super File Cleaner
:EndOfCodeXP

:7
CLS
@COLOR 04
@ECHO OFF
setlocal enabledelayedexpansion
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

for /F "tokens=1 delims=[]" %%N in ('find /N ":StartOfCode7" ^<"%~f0"') do set start=%%N
for /F "tokens=1 delims=[]" %%N in ('find /N ":EndOfCode7"   ^<"%~f0"') do set /A lines=%%N - start
set line=0
for /F "skip=%start% usebackq tokens=* delims=" %%L in ("%~f0") do (
  call %%L 2>nul >nul
  set /P j=Û< NUL
  set /A line += 1
  set /A pct= line * 100 / lines
  title !pct!^% done
)  

GOTO Done

:StartOfCode7
cd /D %SYSTEMDrive%\
RD /s /q "%WINDIR%\Prefetch"
RD /s /q "%TEMP%"
RD /s /q "%USERPROFILE%\Local Settings\Temp"
RD /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files"
RD /s /q "%USERPROFILE%\Cookies"
RD /s /q "%SystemRoot%\Downloaded Program Files"
RD /s /q "%SystemRoot%\Temp"
RD /s /q "%SystemRoot%\tmp"
RD /s /q "C:\$Recycle.bin"
REM  ---Super File Cleaner
del /f /s /q %SystemDrive%\*.log
del /f /s /q %SystemDrive%\~*.* 
del /f /s /q %SystemDrive%\*.tmp
del /f /s /q %SystemDrive%\*.bak
del /f /s /q %SystemDrive%\*.old
REM  ---END of Super File Cleaner
:EndOfCode7

:Done
CLS
@COLOR 0A
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@Echo º      Your System is now Clean       º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@PAUSE
CLS
GOTO MENU

Open in new window

Author

Commented:
Your right, there was some differences but i think i pasted over it.. i ll have to find an older version of the bat to confirm.. but thats the reason for different StartofCode's.

I like how everything can be in a menu, and we use these tools from time to time.

would you suggest a different route?

Author

Commented:
ok so i found it, Windows 7the locations are different:

cd %SYSTEMDrive%\
RD /s /q "%WINDIR%\Prefetch"
RD /s /q "%USERPROFILE%\Temp"
RD /s /q "%USERPROFILE%\AppData\Local\Temp"
RD /s /q "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files"
RD /s /q "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies"
RD /s /q "%SystemRoot%\Downloaded Program Files"
RD /s /q "%SystemRoot%\Temp"
RD /s /q "%SystemRoot%\tmp"

Open in new window

Author

Commented:
ohh i  think i get it... your saying let the code determine the OS, and then choose the path to clean?

Author

Commented:
Do i keep the REM's in that version selection?
"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
To be honest, I would change the scripting to a "brute-force" method like this:


@ECHO OFF
setlocal enabledelayedexpansion

Set RemoveDirs=	"%TEMP%" "%TMP%" "%SystemRoot%\Temp" "%SystemRoot%\tmp" "%USERPROFILE%\Local Settings\Temp" ^
		"%USERPROFILE%\Local Settings\Temporary Internet Files" "%USERPROFILE%\Cookies" ^
		"%SystemRoot%\Downloaded Program Files" ^
		"%WINDIR%\Prefetch"  "C:\$Recycle.bin"
if defined LOCALAPPDATA set RemoveDirs=RemoveDirs "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files" "%LOCALAPPDATA%\Temp"

set DelFiles=*.log ~ ~*.* *.tmp *.bak *.old


CLS
@COLOR 04
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

set maxval=0
for %%A in (%RemoveDirs% %DelFiles%) do set /A maxval += 1

set val=0
for %%A in (%RemoveDirs%) do (
  rd /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)  

for %%A in (%DelFiles%) do (
  del /f /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)

CLS
@COLOR 0A
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@Echo º      Your System is now Clean       º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@PAUSE
CLS

Open in new window

Author

Commented:
I think i got it....

for /F "tokens=4,5* delims=[].^ " %%A in ('ver') do (
     if %%A.%%B==5.0 goto W2K
     if %%A.%%B==5.1 goto XP
     if %%A.%%B==5.2 goto W2K3
     if %%A.%%B==6.0 goto Vista_W2K8
     if %%A.%%B==6.1 goto W7

Open in new window

Author

Commented:
I like the Brute force method too... It makes the Script more organised. let me try it..

Author

Commented:
So i tried the Brute force method and it didn't look like it cleaned anything...

It did show me the % bars really fast though...

here's what i'm using:

color 0A
:MENU
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º      Choose Your Tool       º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO 1 - Universal Temp Cleaner
ECHO.
SET /P M=Select a number, then press ENTER: 
IF %M%==1 GOTO Clean

:Clean
for /F "tokens=4,5* delims=[].^ " %%A in ('ver') do (
     if %%A.%%B==5.0 goto W2K
     if %%A.%%B==5.1 goto XP
     if %%A.%%B==5.2 goto W2K3
     if %%A.%%B==6.0 goto Vista_W2K8
     if %%A.%%B==6.1 goto W7
)

:W2K
ECHO Sorry this feature not available yet.
PAUSE
CLS
GOTO Menu

:XP
setlocal enabledelayedexpansion

Set RemoveDirs=	"%TEMP%" "%TMP%" "%SystemRoot%\Temp" "%SystemRoot%\tmp" "%USERPROFILE%\Local Settings\Temp" 	"%USERPROFILE%\Local Settings\Temporary Internet Files" "%USERPROFILE%\Cookies" "%SystemRoot%\Downloaded Program Files" "%WINDIR%\Prefetch"  "C:\$Recycle.bin"

if defined LOCALAPPDATA set RemoveDirs=RemoveDirs "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files" "%LOCALAPPDATA%\Temp" "%APPDATA%\Microsoft\Windows\Cookies"

set DelFiles= 	*.log  ~*.* *.tmp *.bak *.old


CLS
@COLOR 04
@ECHO.
@ECHO.
set i=0
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

set maxval=0
for %%A in (%RemoveDirs% %DelFiles%) do set /A maxval += 1

set val=0
for %%A in (%RemoveDirs%) do (
  rd /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)  

for %%A in (%DelFiles%) do (
  del /f /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)

CLS
@COLOR 0A
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@Echo º      Your System is now Clean       º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@PAUSE
CLS
GOTO Menu

:W2K3
ECHO Sorry this feature not available yet.
PAUSE
CLS
GOTO Menu

:Vista_W2K8
ECHO Sorry this feature not available yet.
PAUSE
CLS
GOTO Menu

:W7
setlocal enabledelayedexpansion

Set RemoveDirs=	"%TEMP%" "%TMP%" "%SystemRoot%\Temp" "%SystemRoot%\tmp" "%USERPROFILE%\Local Settings\Temp" ^
		"%USERPROFILE%\Local Settings\Temporary Internet Files" "%USERPROFILE%\Cookies" ^
		"%SystemRoot%\Downloaded Program Files" ^
		"%WINDIR%\Prefetch"  "C:\$Recycle.bin"
if defined LOCALAPPDATA set RemoveDirs=RemoveDirs "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files" "%LOCALAPPDATA%\Temp" "%APPDATA%\Microsoft\Windows\Cookies"

set DelFiles= 	*.log  ~*.* *.tmp *.bak *.old

CLS
COLOR 04
ECHO.
ECHO.
set i=0
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º       Now Cleaning Your System      º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
(Set /P j= ) < NUL

set maxval=0
for %%A in (%RemoveDirs% %DelFiles%) do set /A maxval += 1

set val=0
for %%A in (%RemoveDirs%) do (
  rd /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)  

for %%A in (%DelFiles%) do (
  del /f /s /q "%%~A" 2>nul >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)

CLS
COLOR 0A
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º      Your System is now Clean       º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
PAUSE
CLS
GOTO MENU

Open in new window

Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
Sorry, but you again just used the same code twice, which does not make sense. My approach didn't use any detection of OS, just delete the folders and files if they are there.
If you want to check for the OS, do so, but only to differ between supported and unsupported OS. Like with:

:Clean
for /F "tokens=4,5* delims=[].^ " %%A in ('ver') do (
     if %%A.%%B==5.0 goto unsupported: REM W2k
     if %%A.%%B==5.1 goto supported:      REM XP
     if %%A.%%B==5.2 goto unsupported: REM W2K3
     if %%A.%%B==6.0 goto unsupported: REM Vista_W2K8
     if %%A.%%B==6.1 goto supported:      REM W7
)

(I think you know the remaining code.)

However, I had one typo and one major fault in my script. The FOR doesn't work as desired when using wildcards - I forgot about that totally. Nevertheless, it is better anyways to delete all files with a single DEL command (much faster), but you loose the progress indicator for the deletion operation. The whole deletion will be considered as a single operation, that is weights the same as each RD command.

@ECHO OFF
setlocal enabledelayedexpansion

Set RemoveDirs= "%TEMP%" "%TMP%" "%SystemRoot%\Temp" "%SystemRoot%\tmp" "%USERPROFILE%\Local Settings\Temp" ^
                "%USERPROFILE%\Local Settings\Temporary Internet Files" "%USERPROFILE%\Cookies" ^
                "%SystemRoot%\Downloaded Program Files" ^
                "%WINDIR%\Prefetch"  "C:\$Recycle.bin"
if defined LOCALAPPDATA set RemoveDirs=%RemoveDirs%  "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files" 

"%LOCALAPPDATA%\Temp"

set DelFiles=*.log ~*.* *.tmp *.bak *.old

CLS
@COLOR 0C
@ECHO.
@ECHO.
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@ECHO º       Now Cleaning Your System      º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@ECHO.
(Set /P j= ) < NUL

set maxval=1
for %%A in (%RemoveDirs%) do set /A maxval += 1

set val=0
for %%A in (%RemoveDirs%) do (
  rd /s /q "%%~A" 2>nul >nul
  ping -n 1 -w 1 127.0.0.1 >nul
  set /P j=Û< NUL
  set /A val += 1
  set /A pct= val * 100 / maxval
  title !pct!^% done
)  

del /f /s /q %DelFiles% 2>nul >nul
set /P j=Û< NUL
set /A val += 1
set /A pct= val * 100 / maxval
title !pct!^% done

rem CLS
@COLOR 0A
@Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
@Echo º      Your System is now Clean       º
@Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
@PAUSE
CLS

Open in new window

Author

Commented:
Thank you that works. Again your awesome.

Author

Commented:
Thank you for your help on this.