hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Batch Problem
liquidSilver
Okay, i'm starting o learn batch - just a little.

I have this code:

CODE
@Echo Off
Cls
IF %1 == A GOTO START
IF %1 == B GOTO START
IF %1 == C GOTO START
IF %1 == D GOTO START
IF %1 == E GOTO START
IF %1 == F GOTO START
IF %1 == G GOTO START
IF %1 == H GOTO START
IF %1 == I GOTO START
IF %1 == J GOTO START
:START
%1:
CD %1:\
DEL "min ho.jpg" /s
DEL "Yearh =).jpg" /s
:END


But, it doesnt work - it should check if it had the harddrive and delete the files from the harddrive(s)

Any solutions?
blackP0ster
CODE

:BEGIN
cls
@echo off
echo.
echo Enter HDD Letter:
echo.
set /p hdd=

if %hdd% == A goto start
if %hdd% == B goto start
if %hdd% == C goto start
if %hdd% == D goto start
if %hdd% == E goto start
if %hdd% == F goto start
if %hdd% == G goto start
if %hdd% == H goto start
if %hdd% == I goto start
if %hdd% == J goto start


:start
dir %hdd%:
pause
DEL /s %hdd%:\MINHO~1.JPG
DEL /s %hdd%:\YEARH_~1.jpg
cls
@echo.
@echo READY TO DEL NEW FILES :)
@echo.
@pause
goto BEGIN


try this one..on my pc it worked well! (win2k sp4)

black
liquidSilver
very cool, but I need it to open and then close quicky again.. But i just remove the echo and such.. Thanks mate, and welcome to GSO wink.gif
liquidSilver
Doh, duouble post.. I just want it, (i compile it to an exe) when you click on it, it start a search on the computer seachen each drive for the files, and if it find it then it deletes it.. ...? hm
blackP0ster
CODE

cls
@echo off
echo.
echo black:blizzard deleting batch :)
echo.
pause

DEL /s c:\MINHO~1.JPG
DEL /s c:\YEARH_~1.jpg
cls
DEL /s d:\MINHO~1.JPG
DEL /s d:\YEARH_~1.jpg
cls
DEL /s e:\MINHO~1.JPG
DEL /s e:\YEARH_~1.jpg
cls
DEL /s f:\MINHO~1.JPG
DEL /s f:\YEARH_~1.jpg
cls
DEL /s g:\MINHO~1.JPG
DEL /s g:\YEARH_~1.jpg
cls
DEL /s h:\MINHO~1.JPG
DEL /s h:\YEARH_~1.jpg
cls
DEL /s i:\MINHO~1.JPG
DEL /s i:\YEARH_~1.jpg
cls
DEL /s j:\MINHO~1.JPG
DEL /s j:\YEARH_~1.jpg
cls
echo.
echo all files found and deleted
echo.
pause


just for you smile.gif
Neo2k
yep good work, you do not have to del he "echo" but the "pause" in black's batch wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.