|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (13 bit)
Join Date: Mar 1999
Posts: 6,791
|
Making a .bat file
Hi all,
I'm wondering whether someone could tell me how to make a .bat file that can be executed everytime win2k starts up and does the following: Clear all cookies Clear temporary internet files Clear history Clear any other directory I want to be cleared. Is this possible? If so can someone tell me how to do this? Thanks. |
|
|
|
|
|
#2 |
|
Red-eyed Moderator
Staff
Premium Member
Join Date: Dec 1999
Location: Regina, Saskatchewan, Canada
Posts: 17,576
|
Get Window Washer to do that.
__________________
-At Ford, quality is job #1, job #2 is making them explode. ~Norm MacDonald, SNL News -Switching to Glide..Balancing in my head..inside of me... taking the glide path instead. |
|
|
|
|
|
#3 |
|
Member (13 bit)
Join Date: Mar 1999
Posts: 6,791
|
Hi Hal,
What is that, just standard shareware of freeware I can dload? Thanks. |
|
|
|
|
|
#4 |
|
Member (12 bit)
Join Date: Dec 1999
Location: Oklahoma
Posts: 3,261
|
Tweak UI will do most of it. You can write commands in Notepad and rename it .bat. Make sure you put quotes around it so it doesn't name it .bat.txt.
|
|
|
|
|
|
#5 |
|
Member (10 bit)
|
Hey Floppyman you can download a trial version of Winder Washer . I've never tried that (.bat) thing with Tweakui but it sounds pretty interesting,my boxes get alot of maintenance so I clean most that stuff manually.
|
|
|
|
|
|
#6 |
|
Member (14 bit)
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
|
Here's the .bat file.
Copy/paste everything in RED, and paste it into your autoexec.bat When you save it, make sure it's saved as autoexec.bat and NOT autoexec.bat.txt If you don't have an autoexec.bat then make it using the following. cd\windows smartdrv REM if you get an error on the above line, delete it. @echo off cd/ ECHO now deleting cookies cd c:\docume~1\username\cookies del. /y cd/ ECHO now deleting Temp cd c:\docume~1\username\Local~1\Temp del. /y cd/ ECHO now deleting temp internet cd c:\docume~1\username\Local~1\Tempor~1 del. /y ECHO add any other pathname here This is untested, but I think it should work. Anyone else, jump in here if you see any errors. |
|
|
|
|
|
#7 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
You could also use the variable in the script for username:
cd c:\docume~1\%username%\cookies to make it work for multiple users. |
|
|
|
|
|
#8 |
|
Professional gadfly
|
For Windows 2K/XP, you can also use the %userprofile% variable, which basically replaces "C:\Documents and Settings\username." I just made a batch file that will create a shortcut on a person's desktop, and the %userprofile% variable is quite handy for that.
So, you could do something like this: del "%userprofile%\cookies\*.*" /q You have to stick the path in quotes because of the spaces, but it works nicely. |
|
|
|
|
|
#9 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Oh yeah, I forgot about the userprofile variable. I just got through building a login script for my PDC. It was a pain to get it working since some computers were 98 and some were 2K/XP. With 98, I use the putinenv.exe file which would set the variables in 98. Just couldn't get any drives to map deep in 98 though.
|
|
|
|
|
|
#10 |
|
Member (14 bit)
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
|
Either of those options would work, but I was assuming that he only wanted to remove HIS, and not everyones stuff...
On another note, you can simply remove the folders completely, and windows will recreate them on boot up, thus: cd\windows smartdrv REM if you get an error on the above line, delete it. @echo off deltree c:\docume~1\username\cookies /y I think that would work as well. Or was it: deltree |y c:\docume~1\username\cookies I can't remember the syntax now, been awhile. Or you could do it this way: cd\windows smartdrv REM if you get an error on the above line, delete it. @echo off cd c:\docume~1\username\ deltree |y cookies deltree |y Local~1\Temp deltree |y Local~1\Tempor~1 cd\ Last edited by reboot; 12-18-2002 at 12:10 PM. |
|
|
|
|
|
#11 |
|
Member (13 bit)
Join Date: Mar 1999
Posts: 6,791
|
Wow, just saw this now, thanks again guys.
|
|
|
|
|
|
#12 |
|
Power in the Box-P4 XEON!
Join Date: May 2001
Location: Europe >Swiss
Posts: 3,014
|
deltree /y c:\docume~1\username\cookies this one will work Reboot - the | will not.
You could use as well this one (modified from reboot) LFN version Deltree /y "C:\Documents and Settings\username\cookies" and then the same for the rest - Hpro
__________________
It's not as hard to do as you may think...It's just that you try.!And I'm still trying..! The Machine: i7 920CPU @ 2.66 Hypertreading / Asus P6T / 12GB DDR3 Ram 1366 / 3 x Sata 160GB Hot Swap / 1x Sata 160GB / 2 x Sata 300 GB / Plextor DVD 800 SATA / Plextor CDRW IDE / Audigy Sound Blaster 24 Bit / ASUS Nvidia ENGT 240/ Chieftec Full Tower / PSU Chieftec 600 Watt / Win7 x64 Ultimate MAPS |
|
|
|
|
|
#13 |
|
Member (14 bit)
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
|
Yeah, that's it...command, then action, then folder. I should have remembered.
|
|
|
|
|
|
#14 |
|
Member (10 bit)
Join Date: Sep 1999
Posts: 883
|
http://users3.ev1.net/~stevengould/cleanup/index.html
Is a small (280kb) program that cleans out the temp folders. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|