Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-17-2002, 11:23 PM   #1
Member (13 bit)
 
Floppyman's Avatar
 
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.
Floppyman is offline   Reply With Quote
Old 12-17-2002, 11:47 PM   #2
Red-eyed Moderator
Staff
Premium Member
 
HAL9000's Avatar
 
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.
HAL9000 is offline   Reply With Quote
Old 12-17-2002, 11:53 PM   #3
Member (13 bit)
 
Floppyman's Avatar
 
Join Date: Mar 1999
Posts: 6,791
Hi Hal,

What is that, just standard shareware of freeware I can dload? Thanks.
Floppyman is offline   Reply With Quote
Old 12-18-2002, 12:58 AM   #4
Tuf
Member (12 bit)
 
Tuf's Avatar
 
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.
Tuf is offline   Reply With Quote
Old 12-18-2002, 02:04 AM   #5
Member (10 bit)
 
dldz's Avatar
 
Join Date: May 1999
Location: Pacific Northwest
Posts: 830
Send a message via ICQ to dldz Send a message via AIM to dldz Send a message via Yahoo to dldz
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.
dldz is offline   Reply With Quote
Old 12-18-2002, 10:10 AM   #6
Member (14 bit)
 
reboot's Avatar
 
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.
__________________
Black holes are where God divided by zero...
Cheers, Jim

Jims Modems
reboot is offline   Reply With Quote
Old 12-18-2002, 11:07 AM   #7
Staff
Premium Member
 
mairving's Avatar
 
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.
mairving is offline   Reply With Quote
Old 12-18-2002, 11:18 AM   #8
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
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.
doctorgonzo is offline   Reply With Quote
Old 12-18-2002, 12:02 PM   #9
Staff
Premium Member
 
mairving's Avatar
 
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.
mairving is offline   Reply With Quote
Old 12-18-2002, 12:04 PM   #10
Member (14 bit)
 
reboot's Avatar
 
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.
reboot is offline   Reply With Quote
Old 01-02-2003, 12:56 AM   #11
Member (13 bit)
 
Floppyman's Avatar
 
Join Date: Mar 1999
Posts: 6,791
Wow, just saw this now, thanks again guys.
Floppyman is offline   Reply With Quote
Old 01-02-2003, 02:44 AM   #12
Power in the Box-P4 XEON!
 
Hpro's Avatar
 
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
Hpro is offline   Reply With Quote
Old 01-02-2003, 10:21 AM   #13
Member (14 bit)
 
reboot's Avatar
 
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.
reboot is offline   Reply With Quote
Old 01-03-2003, 09:25 AM   #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.
Briab Guy is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2