-
April 4th, 2005, 07:38 AM
#1
del *.* except one thing
heres what im looking to do
we run a purge script to nuke cookies & the like on reboot or shut down
each user has a cookie to there jupiter/meridius quarantine list for email spam
the cookie is called username@webmin[2]
my goal here is kill/nuke/purge all temp & cookie crap except that cookie
here is the script we are using to kill cookies for all accounts on a workstation:
for /D %%d in ("C:\Documents and Settings\*.*") do deltree /y "%%d\cookies\*.*"
i had the idea to copy the cookie out then copy the cookie back in but not for all users & have it return to the right spot
there is no except tab with either deltree or del that i could find
as always many thanks in advance
-
April 4th, 2005, 09:41 PM
#2
Registered User
I don't know how you could do it with a script, but there is a program called Disk Cleaner that is pretty handy. You can configure what it should clean, and you can specify certain cookies to keep. Then, you run the program like this:
diskcleaner.exe -preset
It's not quite that simple, but the point I'm getting at is it would be very simple to integrate that into a logon script. And it's small and doesn't need to be installed, just call it from the server.
-
April 5th, 2005, 01:53 PM
#3
that lil util is kinda neat but wont do....
ill splain
win2k/xp
seperate profiles
each cookie starts with the name of the profile
example
username1@thecookieiwantokeep[2].txt
username2@thecookieiwantokeep[2].txt
username3@thecookieiwantokeep[2].txt
username4@thecookieiwantokeep[2].txt
username5@thecookieiwantokeep[2].txt
And the location is gonna be
c:\docs & settings\username1\cookies
c:\docs & settings\username2\cookies
c:\docs & settings\username3\cookies
c:\docs & settings\username4\cookies
c:\docs & settings\username5\cookies
this would be much easier if deltree or del had an exclude switch like xcopy does...but whatev
-
April 5th, 2005, 06:54 PM
#4
It's been a long time since i've used dos command line ( i prefer linux), but why don't you just modify your existing script a little bit by doing something like this:
for /D %%d in ("C:\Documents and Settings\*.*")
do
move %PATH%\username1@thecookieiwantokeep[2].txt ..\tempcookies\
deltree /y "%%d\cookies\*.*"
move %PATH%\tempcookies\*.* ..\tempcookies
...
whatever else you want to do...
...
Would that work out for you?
-
April 5th, 2005, 11:00 PM
#5
Registered User
Ok here's the best solution for what you are doing.
Download http://www.ccleaner.com/
It has settings in the program that will allow you to choose which cookies you want to keep. You can also set it up to delete all that stuff when you restart your computer. It works with firefox and IE so you shouldn't have any problems there.
Now was that so hard?
Mess with the best, Die like the Rest.
-
April 6th, 2005, 04:35 AM
#6
I tried this copying my CNN cookie out to the root of C and back again and it seemed to work.
@echo off
c:
cd\
cd %userprofile%
cd cookies
copy /y *.cnn[1].txt c:\
del /f /q *.*
copy /y c:\*.cnn[1].txt
exit
-
April 6th, 2005, 06:24 PM
#7
Registered User
Try This...
This worked in my limited testing :
mkdir c:\Cookie
cd \Documents and Settings
for /D %%d in (".\*.*") do copy "%%d\cookies\%%d@webmin[2]" c:\Cookie\*.*
for /D %%d in (".\*.*") do rmdir /s/q "%%d\cookies"
for /D %%d in (".\*.*") do mkdir "%%d\Cookies"
for /D %%d in (".\*.*") do copy "c:\Cookie\%%d@webmin[2]" "%%d\cookies\*.*"
rmdir /s/q c:\Cookie
Sounds like you are asking this for use in a company. Remember to check the licenses if you decide to use one of those programs that were mentioned. Some are not free for use by a company.
Last edited by Vip2; April 6th, 2005 at 06:35 PM.
-
April 7th, 2005, 09:35 AM
#8
Originally Posted by Vip2
This worked in my limited testing :
mkdir c:\Cookie
cd \Documents and Settings
for /D %%d in (".\*.*") do copy "%%d\cookies\%%d@webmin[2]" c:\Cookie\*.*
for /D %%d in (".\*.*") do rmdir /s/q "%%d\cookies"
for /D %%d in (".\*.*") do mkdir "%%d\Cookies"
for /D %%d in (".\*.*") do copy "c:\Cookie\%%d@webmin[2]" "%%d\cookies\*.*"
rmdir /s/q c:\Cookie
Sounds like you are asking this for use in a company. Remember to check the licenses if you decide to use one of those programs that were mentioned. Some are not free for use by a company.
i tried this & it doesnt seem to work
what os? im trying to do this in xp pro
-
April 7th, 2005, 09:47 AM
#9
Registered User
Originally Posted by MAXIMUS2111-SPQR
i tried this & it doesnt seem to work
what os? im trying to do this in xp pro
Windows 2000.
Did they change that much in XP?
Are you using a ".CMD" file or a ".BAT"? It needs to be a ".CMD".
I do not have a XP installation at work so I cannot test it.
-
April 7th, 2005, 09:48 AM
#10
aha that could be it right there
lemme give it a shot
-
April 7th, 2005, 10:04 AM
#11
we got a winner jonny
thanks vip you rule
Similar Threads
-
By gxavier in forum Tech Lounge & Tales
Replies: 55
Last Post: January 23rd, 2002, 12:04 PM
-
By arokh in forum Networking
Replies: 1
Last Post: October 3rd, 2001, 03:54 AM
-
By [NeoZeeD] in forum Tech Lounge & Tales
Replies: 22
Last Post: July 5th, 2001, 06:44 AM
-
By jaeger in forum Tech Lounge & Tales
Replies: 16
Last Post: May 18th, 2001, 06:35 AM
-
By NooToo in forum Tech Lounge & Tales
Replies: 48
Last Post: May 7th, 2001, 07:28 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks