Script for deleting the directories
HI
Someone can write me a cmd script that deletes all directories (including the system and hidden directories) of an hard-disk except those that belong to a list of specific directories in the subdirectory \Users\[Account-users]\ ?
Unfortunately, I'm not a programmer and I do not know how to write this script.
THANKS
BYE
P.S This script must work with Windows PE 2.1 32/64 bit and with Vista SP1 32/64 bit.
Someone can write me a cmd script that deletes all directories (including the system and hidden directories) of an hard-disk except those that belong to a list of specific directories in the subdirectory \Users\[Account-users]\ ?
Unfortunately, I'm not a programmer and I do not know how to write this script.
THANKS
BYE
P.S This script must work with Windows PE 2.1 32/64 bit and with Vista SP1 32/64 bit.
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
suchi.jigar
15 years ago
Posted by:
balubeto
15 years ago
Posted by:
balubeto
15 years ago
Posted by:
McRip
15 years ago
Posted by:
abking99
15 years ago
Hi, u can use below script as well for your reference.
@echo off
IF EXIST C:\Nvidia\ rmdir /S /Q C:\Nvidia > NUL
IF EXIST C:\Ati\ rmdir /S /Q C:\Ati > NUL
IF EXIST C:\Temp\ rmdir /S /Q C:\Temp > NUL
IF EXIST C:\Windows\Temp\ rmdir /S /Q C:\Windows\Temp > NUL
md c:\Windows\temp
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\RECYCLER cacls %%d\RECYCLER /E /G %USERNAME%:F > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\RECYCLER rmdir /S /Q %%d\RECYCLER > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\$RECYCLE.BIN rmdir /S /Q %%d\$RECYCLE.BIN > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST "%%d\System Volume Information" cacls "%%d\System Volume Information" /E /G %USERNAME%:F > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST "%%d\System Volume Information" rmdir /S /Q "%%d\System Volume Information" > NUL
#here is for polish lang in english change from \ustawienia lokalne\ to \local settings\
rmdir /S /Q "%USERPROFILE%\Ustawienia lokalne\temp"
rmdir /S /Q "%USERPROFILE%\Ustawienia lokalne\Temporary Internet Files\Content.IE5\"
@echo off
IF EXIST C:\Nvidia\ rmdir /S /Q C:\Nvidia > NUL
IF EXIST C:\Ati\ rmdir /S /Q C:\Ati > NUL
IF EXIST C:\Temp\ rmdir /S /Q C:\Temp > NUL
IF EXIST C:\Windows\Temp\ rmdir /S /Q C:\Windows\Temp > NUL
md c:\Windows\temp
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\RECYCLER cacls %%d\RECYCLER /E /G %USERNAME%:F > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\RECYCLER rmdir /S /Q %%d\RECYCLER > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\$RECYCLE.BIN rmdir /S /Q %%d\$RECYCLE.BIN > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST "%%d\System Volume Information" cacls "%%d\System Volume Information" /E /G %USERNAME%:F > NUL
FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST "%%d\System Volume Information" rmdir /S /Q "%%d\System Volume Information" > NUL
#here is for polish lang in english change from \ustawienia lokalne\ to \local settings\
rmdir /S /Q "%USERPROFILE%\Ustawienia lokalne\temp"
rmdir /S /Q "%USERPROFILE%\Ustawienia lokalne\Temporary Internet Files\Content.IE5\"
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.