A little DOS help please?

Impulse4life

Windows Perfectionist
Joined
16 Jan 2004
Messages
52
I am trying to delete a file through dos, and I cant because the file has spaces in it!! For example, how would I delete this file:

C:/file a.exe

You cannot type "del file a.exe" because it has a space in it. I am thinking that the file needs to be renamed first but I dont know how to go about doing that through dos either so... a little help would be great! Dos is not my area of expertise. :p

Thanks :cool:
Jamie
 
Put it in quotes - del "C:\file a.exe"
or
use the short file name (use the dir /x command to find out what it is).
 
Another cheat del file*.exe

Make sure there are no other files that the wild card (*) would take out.

A safer approach del file?a.exe

The ? wild card only coers one letter now.

DOS was great. I miss it
 
Short Filename Method - Expanded

Note, generating short filenames must have been enabled before the creation of the file. So this method won't work if you enable short filenames and try to delete a file that was created before it was enabled, you must use del "file a.exe" (long filename) in this case. LeeJend's is probably the easiest. :)

See screenshot using del with short filenames, and the zip file to enable short filename creation for future reference.
 

Attachments

  • Enable8dot3Names.zip
    276 bytes · Views: 25
Chaos, in your reg file that is the default setting. The creation of short file names is enabled unless you did disable it, what you should never do. Many programs still rely on short filenames.

Btw guys, what is difficult in just surrounding a filename with quotes?
 
haha yeah I can live with the quotation marks route. The rest are all neat tricks I mean its not like I use dos on a regular basis and I need the fastest route possible. Thanks Guys!
 
yoyo said:
Chaos, in your reg file that is the default setting.

:) some tweak programs disable it, some people disable it without knowing better. Now they know better. :D
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back