A little DOS help please?

Discussion in 'Windows Desktop Systems' started by Impulse4life, Apr 9, 2004.

  1. Impulse4life

    Impulse4life Windows Perfectionist

    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
     
  2. yoyo

    yoyo _________________

    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).
     
  3. LeeJend

    LeeJend Moderator

    Messages:
    5,291
    Location:
    Fort Worth, TX
    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. chaos945

    chaos945 Moderator

    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.
     

    Attached Files:

  5. yoyo

    yoyo _________________

    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?
     
  6. Impulse4life

    Impulse4life Windows Perfectionist

    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!
     
  7. chaos945

    chaos945 Moderator

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