# Deleting In DOS



## sofaboy (Sep 30, 2007)

How can I find a favorites entry in DOS and delete it ?


----------



## Rockn (Jul 29, 2001)

Why not delete it in Internet Explorer? If you are doing it in DOS you have to CD(change Directory to the one you are looking for and issue the del command. YOu can use a DIR /s to find the file.


----------



## sofaboy (Sep 30, 2007)

I am dealing with a long name file that windows will not let me delete normaly.
How do I do a change directory to find favorites ?
I typed dir /s but could not find favorites listed.


----------



## ChuckE (Aug 30, 2004)

Deleting a long file name in DOS is a tad more difficult than a simple select and press of the <Delete> key within Windows. So, I don't understand your problem with Windows.

The EASIEST way to get to *your favorites* is to just open the Windows Run window
(you can either select the Windows Start button, and click on [Run]
*OR* just press the Windows+R key)
type "favorites" (no quotes needed - but it won't hurt either)
and then click [OK] (or just press the Enter key).

and you're there!

Note: If you are running the Windows PowerToy "Open Command Window Here" you can very easily jump to the selected folder in a DOS window, by doing a simple right-click selection of the folder.


----------



## sofaboy (Sep 30, 2007)

Windows 98 will not let me delete or rename the link because it is too long.
Is there a way to delete in DOS ?
If so, I need a step by step walk through.
Think of it as DOS for idiots.


----------



## ChuckE (Aug 30, 2004)

I think perhaps you may be confusing the actions you may be attempting in Windows. I have never seen a name, to a file, so long that it could not be deleted. After all, your computer must have been fine with the length of the name when the file was created.

On the other hand, I have seen where the name of a file, AND the path to it, were so long that the file could not be copied to another location. I think there is a 256 character limit to the path+file name. When I have seen that it would just give an error message that the file could not be copied. But, sorry, I don't understand the problem with just deleting the file. Seems to me, that if you can select the file, then you can just press the Delete key.

Perhaps... and this is a guess! if your path+file name is pressing up against that 256 character limit, and you are doing the usual Delete(to the Recycle Bin), the path+file name has to grow a bit to maintain where the file originally came from. Doing that, then perhaps that exceeds the 256 character barrier.

If that is so, then - and only if you are really sure you want to delete the file, hold down the SHIFT key when you go to delete the file. Doing a "Shift+Delete" will make the file really delete - it will not be moved to the Recycle Bin.

Alternately, and for the same reason, you could move the file up a directory or two (if you can) so that the path+file name is a bit shorter.

As for being able to delete the file through DOS, sure there are ways. But I am hesitant in telling you that way when the method through the Windows interface should be easier. I'd hate to go off on a needless "step-by-step" narrative when it may get more complicated than you may be able to handle at this juncture.


----------



## sofaboy (Sep 30, 2007)

When I try to delete the link I get the following message "Cannot delete file. The filename you specified is invalid or too long."
I cannot move the link or delete it.
When I tried to delete or move it from the favorites folder I got the same message.
The Link I am trying to delete is over a hundred and forty letters long.
Windows is TELLING me it will not delete it. 
I am not confused about this.


----------



## JohnWill (Oct 19, 2002)

Actually, it's possible for directory entries to get corrupted and create an invalid MS-DOS name. Invalid characters in the name is the most common cause.

I find that I can move all the other files out of the folder and delete the folder and recreate it to get rid of some of these problem files.


----------



## DaveBurnett (Nov 11, 2002)

That was one of the things XtreePro was good for.
It would handle any old cr&*py files.


----------



## ChuckE (Aug 30, 2004)

If you really need to use DOS to delete the file, assuming you are on a WinXP system:
Open the DOS window (one way, select Start>All Programs>Accessories>Command Prompt)
Change to the required directory
(For example *cd "\Documents and Settings\Chuck\My Documents\Tax Deductions"*)
(Note, if there are spaces anywhere in the path you will need to put the entire path inside quotes)
See if the file you want to delete is there by doing a *DIR*
(Note, if you have many files there, you can just do a partial listing by just entering the first letter (or more) of the file name and an *)
(for example *DIR so**, you do not have to enter in the filename extension)
(another example, you could list just the files with just some part of the file name or the extension using *DIR *name** or *DIR *.txt*
IF ONLY the file you want to delete is listed using that * in the DIR command, you can use that exact same name convention in the following *DEL*ete command
Once you are sure that the file you want to delete is in the directory you are in, you can just type in the delete command and name that file, 
for example *DEL thatreallylongfilename.xyz*
(Note, you probably do not, or perhaps even can not, type in the longlong filename, that was why I mentioned the earlier wildcard (*) DIR examples)
(In that case you could just type in *DEL *really** and get rid of that "thatreallylongfilename.xyz" file)
(*CAUTION CAUTION CAUTION!* You *really ought* to ensure the wildcard only lists just the one file with the DIR command first.
Because using the wildcard will delete ALL files that the wildcard matches - no if's and's or but's)
(Or, as a precaution, you could use a "/P" switch on the command line to be prompted for the deletion of any file found,
for example *DEL *really* /P* or *DEL /P *really**
Using the */P* switch you will have to enter a Y or N (and press the Enter key) for each file found.)

Good luck, and I hope you don't delete a file you really wanted.


----------



## sofaboy (Sep 30, 2007)

OK nothing is working so far.
I created a new folder moved all the favorites but the one I want to delete and tried to delete the original folder and Windows will not let me delete or rename the favorites folder, so that shoots down that idea.
I tried locating favorites or the file in DOS with DIR command, and favorites is not listed neither is the file I want to delete.
Any other ideas?


----------



## ChuckE (Aug 30, 2004)

You can't locate your "Favorites" directory using DOS?

Then you are doing something wrong, since the Favorites is not hidden at all.

Tell me this:
1) Are you using Windows XP?
1b) If not what OS are you using?

2) Is this "file" that you are wanting to delete, seen when using Windows Internet Explorer? 
2b) If not, then what browser are we talking about?

If the "file" is just a bookmark using another browser, then those bookmarks may not be individual files at all. If it is some other browser then they are probably just entries in a single "Bookmark.htm" file used by that browser.


----------



## sofaboy (Sep 30, 2007)

I am using WIN98.
The favorites link is in IE and the browser I use normaly K-Meleon.
I looked in the K-Meleon folder and there is no favorites folder the way there is in the Windows folder.


----------



## ChuckE (Aug 30, 2004)

ChuckE said:


> ... If it is some other browser then they are probably just entries in a single "Bookmark.htm" file used by that browser.


----------



## ChuckE (Aug 30, 2004)

And on the K-Meleon page regarding Bookmarks page, it says:
"The first time K-Meleon is run with the Netscape Bookmark Plugin enabled, it automatically creates a new *bookmarks file* in your profile directory."


----------



## ChuckE (Aug 30, 2004)

I told you that you should have started your own thread regarding your problem. If you had initially Subject lined your real problem, something like "Can't locate and remove a bookmark in K-Meleon" then you probably would have had a quicker answer.

I have never used or heard of K-Meleon. But others surely have, and identifying your real issue, instead of burying it in this "Deleting in DOS" thread may have gotten you to that answer much quicker.

I would venture that there are tools within K-Meleon that can be used to clean up, add, or remove "favorites" in that K-Meleon bookmark file.

A bookmark file is NOT how IE maintains its Favorites, as you have now learned. I hope this helps.


----------



## sofaboy (Sep 30, 2007)

Ok I found the answer I was looking for. This worked and the link is gone.

"If you are certain it is not a system file or otherwise important, then...

(1) "START, Programs, MS-DOS Prompt".
(2) Type "DEL " at the C:\ Prompt. (No quotes, but there is a space.)
(3) Open Explorer to that file.
(4) Grab the file with the R-Mouse button & drag it over the Prompt button in the Taskbar.
(5) When the DOS window opens, drop the file into it.

Hit the Enter key, if you've dragged the right one into there.

If that doesn't do it (because the file is in use), then "START, Shut down, Restart in MS-DOS mode", and DEL the short name there.

Thank William and Linda Allen, really, for this methodology." 

This had nothing to do with my browser. Thanks for your time guys.


----------



## ChuckE (Aug 30, 2004)

If that process worked then that proves that it actually was a real file, viewable in the Explorer. The only thing missing was your correctly naming the file when you wanted to see (via DIR) the file and when you wanted to delete it.

Dropping the selected file on the "Prompt button in the Taskbar" (or just dragging it into the opened Command Prompt DOS window - which is the same window through a different, but more direct, route) will simply place the complete filename, within quotes (") on the command line - which you have already preceded with the DEL command.

That is a neat trick, by the way, I didn't know it did that. I have used other methods of getting the full path\filename using the Run window. But for this use, dropping the file on the Command Prompt window, is more direct. Thanks.

But *sofaboy* there is nothing there that could not have been done via the usual DOS commands, and especially with the wildcard and /P methods I mentioned. My guess is that you were not entering the proper quotes, when needed, to ensure that a file or path name was correctly named.

By the way, there is a feature that the Command Prompt window has that you may not know about.
(I believe this is the default setting of the Command prompt window, too.) That is:
The use of the <Tab> key will expand the typed characters to fill out the file name or the path.

Try this, go to the Command prompt and first type *CD \*, that will get you to the root of the C: drive - (that's not the trick), then
type *CD D* and (here's the trick) press the <Tab> key.

On my computer, I have several directories that start with the letter "D" (Dell, "Documents and Settings", Downloads, and Drivers). As I press the <Tab> key, successive times, I will see those names, one per press, and after the last, it will go through the same list again. 
What is interesting is that when the path has a space in the name, the required quotes (") are automatically included. You also are not limited to just typing one character before you press the <Tab> key, you could enter more characters (that you are sure of) and then the pressing of the <Tab> key will be more direct to getting where or what you want.

So, If I needed to get to the "C:\Documents and Settings\Chuck\My Documents\Chuck Web" directory, to remove the "x y z.htm" file, I could do this:

Open a Command prompt window, and enter *CD \* to get to the root. Then (case does not matter):
Type *DEL DO*<Tab>
At that time I see this on the line:
*C:\>DEL "Documents and Settings"*
(If that is not the directory, then just press <Tab> again until it is correctly shown.)
Then just type a *\C* (don't worry about the backslash being outside of the quotes) and you'll see this on the line:
*C:\>DEL "Documents and Settings"\C*
When you then press <Tab> the line changes to:
*C:\>DEL "Documents and Settings\Chuck"*
(If that is not the directory, then just press <Tab> again until it is correctly shown.)

Continuing on, to get to the place I need to be, typing *\M*<Tab>, I now see:
*C:\>DEL "Documents and Settings\Chuck\My Documents"*
typing *\CH*<Tab> (pressing <Tab> as many times as needed to finally see:
*C:\>DEL "Documents and Settings\Chuck\My Documents\Chuck Web"*

Now, actually in the directory I need to be in, I just need to name the file "x y z.htm" I want to delete.

Being lazy, I don't want to, or need to, enter the whole name. So I just enter *\x*<Tab> (as many <Tab>s and needed) and finally see:
*C:\>DEL "Documents and Settings\Chuck\My Documents\Chuck Web\x y z.htm"*

Seeing just the file I want, I can just press the <Enter> key, and ... Gone!

Moral, or lesson, of the steps, the <Tab> key is VERY HANDY in the DOS Command Prompt window.
(*NOTE:* Readers, if your <Tab> key does not do the expansion in the DOS Command Prompt, then it is a feature that you can easily enable with a simple registry edit, (or use the XP "Tweak UI" Powertoy).


----------

