/build/static/layout/Breadcrumb_cap_w.png

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.

0 Comments   [ + ] Show comments

Answers (7)

Posted by: suchi.jigar 11 years ago
Purple Belt
0
I can help you......I will give you a bat file, and you just have to enter which directories you want to delete. Will it be ok?
Posted by: balubeto 11 years ago
Senior Yellow Belt
0
ORIGINAL: suchi.jigar

I can help you......I will give you a bat file, and you just have to enter which directories you want to delete. Will it be ok?


Ok. You can create a cmd script instead of a bat script?

THANKS

BYE
Posted by: anonymous_9363 11 years ago
Red Belt
0
They're the same thing, but with a different extension.
Posted by: balubeto 11 years ago
Senior Yellow Belt
0
ORIGINAL: VBScab

They're the same thing, but with a different extension.


So, I expect your script.

THANKS

BYE
Posted by: anonymous_9363 11 years ago
Red Belt
0
...and I expect your payment. I don't work for free :)
Posted by: McRip 11 years ago
Orange Senior Belt
0
Just use a cmd file with this code. But I don't know which directory you want to delete...

cmd.exe /c RD "%ProgramFiles%\DUMMYFOLDER" /S /Q
or
cmd.exe /c RD "%SYSTEMROOT%\DUMMYFOLDER" /S /Q
or
cmd.exe /c RD "%CommonProgramFiles%\DUMMYFOLDER" /S /Q

Cheers
Posted by: abking99 11 years ago
Second Degree Blue Belt
0
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\"
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ