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
 

yoyo

_________________
Joined
29 Jul 2002
Messages
1,557
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).
 

LeeJend

OSNN Veteran Addict
Joined
25 Jan 2003
Messages
5,291
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
 

chaos945

OSNN Senior Addict
Joined
10 Feb 2003
Messages
934
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: 24

yoyo

_________________
Joined
29 Jul 2002
Messages
1,557
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?
 

Impulse4life

Windows Perfectionist
Joined
16 Jan 2004
Messages
52
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!
 

chaos945

OSNN Senior Addict
Joined
10 Feb 2003
Messages
934
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

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.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,411
Members
5,590
Latest member
miankafir