Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file in a given folder that I want to delete by either running a script or clicking on some shortcut, but I have no idea how to do so.

So if the file is in C:\Program Files\Our crappy software\file to be deleted.txt

How would I have to do this by preferably not using additional software like AutoHotKey and only on Windows systems.

share|improve this question
up vote 4 down vote accepted

Open up notepad and copy the following in to it:

Del C:\"Program Files"\"Our crappy software"\"file to be deleted.txt"

Save this as either a .cmd or .bat file.

Run it!

You can either double click or place a shortcut.

This will allow you to delete from anywhere, alternatively you can use:

Del "file to be deleted.txt"

as long as the working directory is correct, but it is best to use actual paths.

FYI - you do not need quotes for one word names, you just use them where there is a space, alternatively, you can use the old 8.3 file format (for example, go to command prompt and a directory with long files and type dir /x then you can use file~1 instead of "file to be deleted.txt"

share|improve this answer
    
Thanks I think that is exactly what I need, though I'm curious if anyone else will come up with something else – Ivo Flipse Dec 8 '09 at 11:03

if i am understanding the question correctly, you could write a batch script to solve your problem.

something along the lines of:

del "C:\Program Files\Our crappy software\file to be deleted.txt?" /< options>

or something similar.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .