Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

i need help with this batch file


ghost's Avatar
0 0

every thing looks right but i cant get it to stay open

@echooff

:START title hdd whiper

echo. echo plzs pick a drive letter to echo format
echo. echo.

pause

set /p choice1=">>> "

if %choice1%==c GOTO c if %choice1%==d GOTO d if %choice1%==e GOTO e if %choice1%==f GOTO f if %choice1%==g GOTO g if %choice1%==h GOTO h

:c erase rd/s /f /q c:\.

:d erase rd/s /f /q d:\.

:e erase rd/s /f /q e:\.

:f erase rd/s /f /q f:\.

:g erase rd/s /f /q g:\.

:h erase rd/s /f /q h:\.


stealth-'s Avatar
Ninja Extreme
0 0

A batch script will exit once all given commands have finished executing. Put a "pause" on the last line to make it stay open, iirc.


ghost's Avatar
0 0

no go still dose its thing


stealth-'s Avatar
Ninja Extreme
0 0

Well, it works fine for me. Cause you give some more details on how you are running this?

By the way: I hope you're aware that your cases will fall through here. Example: if you enter "c", it will continue to erase all of the other drives after as well.


ghost's Avatar
0 0

fuck thank you how can i fix that. its in a batch file on my desktop and i am the admin on xp home


starofale's Avatar
Member
0 0

zachery980 wrote: fuck thank you how can i fix that. its in a batch file on my desktop and i am the admin on xp home

If you mean fix the fall-through, just add GOTO statements like this:

erase rd/s /f /q c:\*.*
**GOTO END**

:D
erase rd/s /f /q d:\*.*
**GOTO END**

:e
erase rd/s /f /q e:\*.*
**GOTO END**

:f
erase rd/s /f /q f:\*.*
**GOTO END**

:g
erase rd/s /f /q g:\*.*
**GOTO END**

:h
erase rd/s /f /q h:\*.* 

**:END**

stealth-'s Avatar
Ninja Extreme
0 0

EDIT: Ah, someone beat me to that. Still, check where you put the "pause" statement and ensure it's in the same place as where I put mine in the code below. It should work, I just tested it on a WinXP machine.

Something like this should fix that:

@echooff

:START
title hdd whiper

echo.
echo plzs pick a drive letter to
echo format 
echo.
echo.

pause

set /p choice1=">>> "

if %choice1%==c GOTO c
if %choice1%==d GOTO d
if %choice1%==e GOTO e
if %choice1%==f GOTO f
if %choice1%==g GOTO g
if %choice1%==h GOTO h

:c
erase rd/s /f /q c:\*.* 
GOTO fin

:d
erase rd/s /f /q d:\*.* 
GOTO fin

:e 
erase rd/s /f /q e:\*.* 
GOTO fin

:f
erase rd/s /f /q f:\*.* 
GOTO fin

:g
erase rd/s /f /q g:\*.* 
GOTO fin

:h
erase rd/s /f /q h:\*.* 
GOTO fin

:fin
echo Action completed.
pause

Does that keep the window open, too?


spyware's Avatar
Banned
0 0

This is not a good idea.


ghost's Avatar
0 0

still the same and the ip changer i made opens fine wtf


stealth-'s Avatar
Ninja Extreme
0 0

spyware wrote: This is not a good idea.

Yeah, probably not, but whatever.

zachery980 wrote: still the same and the ip changer i made opens fine wtf

IP changer? I don't think that does what you think it will.

You've got to be doing something strange with this script, then. It works fine on my end, and you can run other Batch scripts fine, so without more info I can't offer any help. Possibly something you did when creating the file, or running it is all I can think of.


ghost's Avatar
0 0

fixed it the batch file was bad thank you


stealth-'s Avatar
Ninja Extreme
0 0

No problem. Keep in mind though, as Spyware said, since you're obviously not entirely familiar with what you're doing yet it might be better to start with something a little less likely to delete all of your boot files. Glad you got it working, though.


t0xikc0mputer's Avatar
Member
0 0

Ah, Batch. I stopped programming in that after the first month, because I was extremely ignorant and didn't know enough commands to actually do anything. I also tried to find a keylogger or make one. Can you imagine a working batch keylogger? Or at least not one that is hidden.