Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Batch File

  1. #1
    Rob
    Rob is offline
    Maximum Bitrate Rob's Avatar
    Join Date
    Aug 2001
    Location
    Missing In Action
    Posts
    779

    Batch File

    I'm trying to write a batch file to delete the contents of my temory internet items folder on bootup, however I'd like it to keep a couple of cookies for obvious reasons.

    This is what I've got so far:

    Code:
    del c:\Windows\Tempor~1
    
    undelete c:\Windows\Tempor~1\rob@www.mp3car.com/
    
    undelete c:\Windows\Tempor~1\rob@www.minimania.com/
    Now here are the problems:

    1) Can't find the folder, I believe I've got the DOS name correct, and I've been able to delete the contents of other folders no problem.

    2) It prompts me for a key board press of y or n before it will delete the contents of the file, is there anyway to bypass this?

    3) Undelete doesn't work.

    Any help here would be great.
    And you say people actually pay money for M$ Windows?
    www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
    Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

  2. #2
    FLAC
    Join Date
    May 2002
    Location
    Sef'Kylar
    Posts
    1,421
    instead of undelete you can first copy your cookies to a different folder, delete the temp folder, then copy the files back (or move if you like)

    windows likes to protect that folder.. you might be better off with something like "del c:\windows\tempor~1\*.* /s" I +think+ that works..
    aka Kumaneko
    "Don't make me moderate your ***!"
    Maxima of Doom - project thread - photo gallery
    mp3car system is currently FUBAR and finances do not allow for a correction of that situation
    Real computer hackers use a rotary cutting tool on their motherboard.

  3. #3
    Variable Bitrate
    Join Date
    Sep 1999
    Location
    Yarmouth NS, Canada
    Posts
    336
    2) use del /q will delete without confirmation (stands for quiet mode).

    3) There is no undelete since msdos .. Best way would be to copy the cookies out somewhere else first, delete all the cookies then copy them back.. You can do it in the batch file.
    MP3 Cavalier - http://www.mp3cavalier.com
    MP3 Grand Prix - http://www.mp3gp.com

  4. #4
    C4M
    C4M is offline
    Maximum Bitrate C4M's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    824
    [DEL] will work to delete files
    [RMDIR] is used to delete directories

    You can't delete a directory that isn't empty.

    Try [RMDIR/?] for help on the switches for [RMDIR]

    Your process should probably be:

    [list=1][*]Copy your wanted cookies somewhere else[*][DEL *.* /q ] the contents of the cookie folder[*]Move the cookie files back to where they came from[/list=1]

    Batch files are fun!

    C!
    http://carpc.riposte.net
    I reserve all rights in connection to each post I author, without exception.

  5. #5
    Rob
    Rob is offline
    Maximum Bitrate Rob's Avatar
    Join Date
    Aug 2001
    Location
    Missing In Action
    Posts
    779
    /q doesn't seem to exist, I keep getting an error message.

    I've gone for the exporting then importing the cookies as the more sensible idea.

    I'm still having trouble acessing the Tempory Internet Items Folder, could and one confirm if I'm using the correct DOS name.

    Thanks for all the help so far.
    And you say people actually pay money for M$ Windows?
    www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
    Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

  6. #6
    C4M
    C4M is offline
    Maximum Bitrate C4M's Avatar
    Join Date
    Apr 2002
    Location
    Sydney, Australia
    Posts
    824
    Originally posted by Rob
    /q doesn't seem to exist, I keep getting an error message.

    I'm still having trouble acessing the Tempory Internet Items Folder, could and one confirm if I'm using the correct DOS name.
    type [DEL/?], and this will give you all the switches for the [DEL] command.

    What version of Winders are you using?

    C!
    http://carpc.riposte.net
    I reserve all rights in connection to each post I author, without exception.

  7. #7
    FLAC MP3DUB's Avatar
    Join Date
    Jan 2002
    Location
    Chicagoland, IL
    Posts
    1,782
    I think part of the problem is that the Temporary Internet Folder isn't really just A folder, even tho thats what windows shows it as. Its really a lot of folders. If you ever download something, say to your desktop, watch what happens when the download gets to 99%, it says copying file from temporary internet files/AQWRWEHGHER/download.exe.
    -Nick

    _____________________________
    Since when is insanity a bad thing?
    Monthly MP3Car Chicago Meets
    www.mp3vw.com Last updated: 07/07/2008

  8. #8
    Constant Bitrate
    Join Date
    Nov 2000
    Location
    VA , USA
    Posts
    193

    Re: Batch File

    Originally posted by Rob
    1) Can't find the folder, I believe I've got the DOS name correct, and I've been able to delete the contents of other folders no problem.

    2) It prompts me for a key board press of y or n before it will delete the contents of the file, is there anyway to bypass this?

    3) Undelete doesn't work.

    Any help here would be great. [/B]
    1. Not sure how to help you here but make sure you can get to it with cd \windows\Tempor~1 from the command prompt to make sure you are using the right name.

    2. try something like

    ECHO Y | DEL [path] \*.*
    DELTREE /Y [path] \*.*

    Either of those might be better. The first one will put a Y into the buffer and run that on the next command so it will be like you trying Y to tell it to go ahead and delete whatever it is. I think you are running 95/98 and I am on windows 2k (as it seems like some other people are from the responces that you have gotten.

    3. yep so move the ones you want to keep ojut of the directory first like others have suggested.

  9. #9
    Maximum Bitrate Raas's Avatar
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    626
    Rob,

    Im

    Thinking of another way... I like what ShinkunoNamida said...

    Just use TweakUI to clear everything, and have a simple batchfile copy the 2 files back from antother location

    Greetz,

    Raas
    Raas - The Netherlands
    ME: VIA epia m10000, lilliput 7', opus 150w, 80gb<br>
    GF: IBM Thinkpad 380, ext. 3.5 80gb, 40x4, PB-IR

  10. #10
    Rob
    Rob is offline
    Maximum Bitrate Rob's Avatar
    Join Date
    Aug 2001
    Location
    Missing In Action
    Posts
    779
    Thanks everyone, it's all working nice and happilly now, and for reference I've attached the code I used.

    Code:
    cd C:\WINDOWS\TEMPOR~1
    copy ROBHES~6.TXT c:\Windows
    
    DELTREE /Y C:\WINDOWS\TEMPOR~1\*.* 
    DELTREE /Y C:\WINDOWS\TEMP\*.* 
    
    cd C:\WINDOWS
    copy ROBHES~6.TXT c:\Windows\TEMPOR~1
    del C:\WINDOWS\ROBHES~6.TXT
    And you say people actually pay money for M$ Windows?
    www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
    Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •