• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

A little DOS help please?

Impulse4life

Windows Perfectionist
#1
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

_________________
#2
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).
 
#3
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
 
#4
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

yoyo

_________________
#5
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
#6
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!
 

Members online

No members online now.

Latest posts

Latest profile posts

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 https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,962
Messages
673,247
Members
89,017
Latest member
Seggar