Computer Hope

Microsoft => Microsoft DOS => Topic started by: tinmce on May 21, 2009, 04:25:01 PM

Title: .bat that formats d drive
Post by: tinmce on May 21, 2009, 04:25:01 PM
Hello! I'm trying to do a .bat file that formats my d drive... I tried these lines...

echo y | format d:\
format d:\ /y
format d:\

any of those didn't work, so now I'm requesting your help :)
I'm using Vista and I'm logged as a Administrator...
Title: Re: .bat that formats d drive
Post by: BatchFileBasics on May 21, 2009, 05:27:21 PM
whats the error that your getting?
Title: Re: .bat that formats d drive
Post by: tinmce on May 21, 2009, 11:04:29 PM
whats the error that your getting?

Nothing. When I run that bat I can see cmd popping up and disappearing immediately.
I think it has something to do with user rights.. When I tried to format d with cmd it said that I don't have rights to do that... Even when I am logged as a administrator... *censored* vista...
Title: Re: .bat that formats d drive
Post by: BatchFileBasics on May 21, 2009, 11:06:39 PM
oh, try right clicking the batch file, and pressing run as admin.

im pretty sure it would work

and for better debugging of a batch file.
open cmd.exe > type the path of your batch file then it should say the error and resume back to the command prompt

so cmd > c:\path of file\file.bat
Syntax error: blah blah blah
c:\>
Title: Re: .bat that formats d drive
Post by: Carbon Dudeoxide on May 21, 2009, 11:22:25 PM
What's wrong with Right Click --> Format?
Title: Re: .bat that formats d drive
Post by: BatchFileBasics on May 21, 2009, 11:32:22 PM
What's wrong with Right Click --> Format?
:o
well good point.

you know, now that you mention it, this is starting to sound pretty malicious ;D

but im sure he just wants to know what the problem is
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 03:46:30 AM
but im sure he just wants to know what the problem is

You're new here, aren't you?
Title: Re: .bat that formats d drive
Post by: squall_01 on May 22, 2009, 05:38:37 AM
kind of wondered myself since its just a straight format driveletter:\
Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 08:13:20 AM
Well, the point was to create bat file that formats d drive.... I know how to format d drive.... But I wanted to create a bat file that does it...

oh, try right clicking the batch file, and pressing run as admin.

im pretty sure it would work

and for better debugging of a batch file.
open cmd.exe > type the path of your batch file then it should say the error and resume back to the command prompt

so cmd > c:\path of file\file.bat
Syntax error: blah blah blah
c:\>

I tried.

C:\Users\Admin\Desktop\zzz.bat

C:\Windows\system32>format d:
Tiedostojärjestelmän tyyppi on NTFS.
Kirjoita aseman D: nykyinen asemanimi
(means... File system is NTFS. Write D: drive's current drivename) ???


Title: Re: .bat that formats d drive
Post by: Carbon Dudeoxide on May 22, 2009, 08:22:45 AM
I think, if you understand what we were saying, is we what to know why....
Title: Re: .bat that formats d drive
Post by: squall_01 on May 22, 2009, 11:57:46 AM
exatly, why do it one way when your probably not going to use it again vs the easy way.
Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 12:33:00 PM
So noone knows how to do bat file that formats d drive?
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 12:57:55 PM
So noone knows how to do bat file that formats d drive?

Many people know. No-one wants to tell you, because we are not sure why you want to know.

Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 01:07:24 PM
I want to know how to create a bat file that formats d drive when running... It should work when just double clicking the bat file
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 01:10:59 PM
I want to know how to create a bat file that formats d drive when running... It should work when just double clicking the bat file

We keep asking you "Why?" and you keep failing to answer that question.
Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 01:40:09 PM
because I want to know how to do that kind of bat file. Does it really need a specific reason??  ??? I have also tried to do bat file that opens different programs at the same time... And it partially worked...

C:
C:\Windows\notepad (this actually works fine)
C:\Program Files\IObit\Advanced SystemCare 3\awc.exe
C:\Program Files\Lavalys\EVEREST Home Edition\everest.exe

but those last two didn't open... -.-
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 01:53:51 PM
because I want to know how to do that kind of bat file. Does it really need a specific reason?? 

Yes. We are a responsible forum. A script that could format without user intervention is potentially disastrous and very few people need to do it. Such a script could be used for malicious purposes, by stupid prank playing idiots, and it is not really all that hard for you to work it out for yourself. Feel free to experiment on your own hardware.

Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 02:19:00 PM
aa now I got it :D hehe I didn't even think about that...  :o well I don't even know how to disguise bat file so that someone would actually run it :D I just wanted to create something effective with bat file... Creating a bat file that opens programs sounds so booring :d but I see that I have to settle with that then...

So could you help me to finish that another bat that opens different programs... ? :)
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 02:53:36 PM
Quote
C:\Windows\notepad (this actually works fine)
C:\Program Files\IObit\Advanced SystemCare 3\awc.exe
C:\Program Files\Lavalys\EVEREST Home Edition\everest.exe

Quote
but those last two didn't open

You need to enclose a path + filename in quote marks if it contains contains one or more spaces
Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 03:29:16 PM
okey. thank you, got it right now :) ;D
Title: Re: .bat that formats d drive
Post by: squall_01 on May 22, 2009, 03:57:07 PM
You want me to toss you in and tell you to swim?
Title: Re: .bat that formats d drive
Post by: tinmce on May 22, 2009, 04:06:31 PM
You want me to toss you in and tell you to swim?

ehm.. wat
Title: Re: .bat that formats d drive
Post by: squall_01 on May 22, 2009, 04:41:40 PM
you have to learn the basic for before you move to the advanced.
Title: Re: .bat that formats d drive
Post by: BatchFileBasics on May 22, 2009, 04:47:56 PM
You're new here, aren't you?


well. yes...besides the point.
Carbon said:
What's wrong with Right Click --> Format?

which is basicly easier. i know.
but he wants to know what is wrong with his script because he COULD just right click and format.
i didn't mean to sound obvious. im just telling carbon that he wants to find the problem instead of just getting over it
Title: Re: .bat that formats d drive
Post by: Dias de verano on May 22, 2009, 04:59:56 PM
Quote
Insert Quote
Quote from: Dias de verano on Today at 10:46:30
You're new here, aren't you?

well. yes...besides the point.

“You must be new here.” is a "Slashdot meme", in other words, the height of wit and humour.

In Soviet Russia, the batch file writes you!

Incidentally, does this remind people of anyone?

Quote
'Junis' referencing the infamous story in which an Afghani named 'Junis' purportedly was back online via his Commodore computer. Used to describe doubt of authenticity of a posted claim, such as 'Junis, is that you?"