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

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.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?

Forum statistics

Threads
62,005
Messages
673,461
Members
5,600
Latest member
CoraPiper