A batch file delete utility

@echo off
echo Drag and drop your file(s) to delete into this window...
Pause >NUL
echo >> asdfasdf1234567890asdfasdfjlkjquiutysyuyteyyysyeythssh >NUL
echo >> asdfasdf1234567890asdfasdfjlkjquiutysyuyteyyysyeythssh >NUL
echo >> asdfasdf1234567890asdfasdfjlkjquiutysyuyteyyysyeythssh >NUL
echo >> asdfasdf1234567890asdfasdfjlkjquiutysyuyteyyysyeythssh >NUL
erase /f /q
echo Job Done, Going off.
echo Click here and press any key...
pause >NUL
end

The above commands are what i have in my delete utility and i am getting a syntax error when i drop any file into the window.
What it is supposed to do is write the line "asdfasdf1234567890asdfasdfjlkjquiutysyuyteyyysyeythssh" quietly to the file, 4 times,
then erase the file by force and all this, quietly.
Does anyone have any answers on how to fix this?
LVL 3
rae_raeAsked:
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.

parkerigCommented:
Hi,
don't believe erase is a dos command.
Is it a special program ?
If it is I suggest you use the full path

Let me know

Ian
0
parkerigCommented:
Stand corrected. My XP machine recognises ERASE
I'll get back to you.

0
rae_raeAuthor Commented:
Actually, I'm running this in winxp and have named the file delete.cmd. The program is going to be a simple utility to write a specified number of times - over the existing data that gets 'dropped into the window' and then erased. The full path to the file is entered into the utility by dropping it into the window. This can be demonstrtated by dropping any file into cmd.exe while running it.
Hope this adds more to help you guys understand what i'm wanting to do...
Thanks.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

parkerigCommented:
The batch file is failing as it is not recognising the file you are dropping onto the window.
You can confirm this by just pressing the space bar to continue - same error.
If you just drop the file onto the batch file it will work if you change the line erase /f /q to

erase %1 /f /q

but this of course assumes user knows to do this

Cheers
Ian
0
rae_raeAuthor Commented:
Maybe you could try this on your machine 'if you havn't', and let me know the exact syntax to put into the code since i am still getting the same error with this...Maybe i'm just slow. Btw, What does the %1 do? Thanks again.
0
parkerigCommented:
Hi,
The %1 effectively runs temp.bat filename
The file must me dropped onto the ICON ( apologies - explanation wasn't that clear ) and it will work ok but it makes the user instructions obsolete as they are just dropping onto the icon not the opened batch file. I will try and find a reference to see if a %variable exists for files dropped onto open DOS windows but I am unaware of one

Apologies for confusion

Ian
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
rae_raeAuthor Commented:
Awesome! I'll wait for another post but as it stands, you have been very helpful to me. Thanks again!
0
parkerigCommented:
Haven't been able to find any info on dropping the file onto the open dos window but I have bookmarked this and if something comes up I'll drop a line

Ian
0
rae_raeAuthor Commented:
Thanks, sorry i didn't get back to say so sooner but i'm visiting family for thanksgiving. Have a happy one...to you and your's ;-)
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
Programming

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.