Which Switch?

Discussion in 'General Hardware' started by Hipster Doofus, Feb 23, 2003.

  1. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    I'm making a cmd file to delete temp files from folders. What switch is used if any to stop being prompted with 'Are you sure (Y/N)?'.
    I want it to continue deleting without the prompt.
     
  2. toxicity

    toxicity Guest

    sorry, cant answer your question. but im intrested in that file you made. you mind posting it?
     
  3. rettahc

    rettahc Guest

    del /Q
     
  4. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    I've only got onto this in the past couple of days & it is very simple.

    I've created a file to backup my entire system using xcopy. In the event of a mely down all I do is run it & my system is restored to a clean install state. Requirers dual booting though.

    Also a backup file to create backups.

    And now this one to delete files.
    For this one open note pad & save it . I used Cleanup.cmd. Not a txt file but cmd)
    First line = Echo off
    Second line = del C:\Docume~1\Hipste~1\Locals~1\Temp\*.*
    Last line = end
    or you can put 'pause' to see what was what.

    Just have to work out that yes/No business with the del one.
     
  5. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    Thanx rettahc that's the one. :D woohoo :D :D
     
  6. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    Another question>

    Is there a way to delete folders that still have files in them?
     
  7. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    you used to be able to use deltree but the DOS that XP uses doesn't support that command.
     
  8. rettahc

    rettahc Guest

    there used to be a util called deltree, but it look like XP dosent have it.
    Umm, so try this one?
    /s Delete specified files from all subdirectories.
     
  9. rettahc

    rettahc Guest

    Ahh found something!!

    rmdir /s
    Removes the specified directory and all subdirectories including any files. Use /s to remove a tree.
     
  10. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    Slowly getting closer. I have to remove the folder then create it again. :happy: w00t w00t
     
  11. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    :( Now I need an exclude command. I tried EXCLUDE but no go. Need to delete files except .dat file.
     
  12. rettahc

    rettahc Guest

    Hmm, thats a tough one. Have you thought about maybe copying the .dat to another location, and then back after the delete?
     
  13. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    I'm stumped too with this one. Can't find anything. It happening with temp internet files. Can't delete .dat because it is being used but can't find a way to skip over it. Ah well, have to keep looking & tryings. Thanx. :)
     
  14. ElementalDragon

    ElementalDragon The One and Only

    Messages:
    3,159
    Location:
    Lehighton, PA
    Hipster, only way i can think of to do that without deleting .dat files is going at it the manual way. sorting files by type, and jus highlighting the files you don't need.
     
  15. eNuffSaid

    eNuffSaid Guest

    Have you tried replacing "Hipste~1" with "%username%"?

    Possible you could replace your second line with:
    del \%TEMP%\*.*

    Check "set" from the command promt for more info

    If you really want to do some batch script magic, I suggest you look into Kix32 (freeware). It came with the WindowsNT4 CD if I remeber correctly, but should be readily downloadable from the iNet.

    Good luck with your scripting.

    Willem Moolenaar
     
  16. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    This is how it finally ended up>

    del C:\Docume~1\Hipste~1\Locals~1\Tempor~1\ /S /Q

    Don't know what is different from what I was trying before. Ran the command & suddenly the folder emptied leaving only the .dat file. Now putting 'end' on the last line it works perfectly, for me anyhow. With some of the other commands I have removed the folder then created it again. Might be the long way but at least it does what I want. :)
    Thanx for all the help & suggestions everyone. :happy:
     
  17. Hipster Doofus

    Hipster Doofus Good grief Charlie Brown

    Messages:
    5,920
    Location:
    Melbourne Australia
    eNuffSaid I download a program called KiX2001_420.zip. Is that the one you are talking about?
     
  18. eNuffSaid

    eNuffSaid Guest

    hahaha... well, you can see I've really been keeping in touch with things. Yes Hipster, that seems to be the way newer version of Kix32 (aka Kixtart). Thanks for the tip! :)

    You've probably found it yourself but this seems to be their "home-page": http://www.kixtart.org/

    Kind regards,
    Willem Moolenaar