quick question

Status
Not open for further replies.
Here one I just did and it works. It just has to be done on logon.

Code:
@echo off
:Menu
cls
echo.
echo clear temp files
echo. ----------------------------------
echo 1. delete files
echo.
echo 2. EXIT
echo ----------------------------------
set /p choice=Select an Action:

pause

echo %choice%

if %choice%==2 goto EXIT
if %choice%==1 goto user

:EXIT
exit

:remove
del c:\windows\temp\*.*
cd %userprofile%\Local Settings\Temp
del *.*
cd %userprofile%\Local Settings\Temporary Internet Files\
del *.*
pause
goto exit


:USER
pause
cd %userprofile%\Cookies
del *.*
pause
goto remove
 
remove all the pauses too. And you can tweak the del commands so it auto enters the yes options and removes any warnings

for all that info type del /? at a cmd prompt
 
:MENU
@echo off
cls
echo.
echo clear temp files
echo. ----------------------------------
echo 1. Cookies
echo 2. History
echo.
echo 3. EXIT
echo ----------------------------------
choice /c:123 " SELECT AN ACTIVITY

if errorlevel ==3 goto leave
if errorlevel ==2 goto HISTORY
if errorlevel ==1 goto USER

:leave
exit

:HISTORY
@echo off
cls
echo.
echo Delete Internet History?
echo. ----------------------------------
echo 1. Yes
echo.
echo 2. NO
echo ----------------------------------
choice /c:12 " SELECT AN ACTIVITY

if errorlevel ==2 goto MENU
if errorlevel ==1 goto remhist

:USER
@echo off
cls
echo.
echo Delete Cookies?
echo. ----------------------------------
echo 1. Yes
echo.
echo 2. NO
echo ----------------------------------
choice /c:12 " SELECT AN ACTIVITY

if errorlevel ==2 goto MENU
if errorlevel ==1 goto cookies



:cookies
echo Cookie Monster is going to get your cookies
cd %userprofile%\cookies
dir
pause
del /f %userprofile%\Cookies
echo Cookie Monster is full
pause
echo .---. .---.
echo : : o : me want cookie!
echo _..-: o : :-.._ /
echo .-'' ' `---' `---' " ``-.
echo .' " ' " . " . ' " `.
echo : '.---.,,.,...,.,.,.,..---. ' ;
echo `. " `. .' " .'
echo `. '`. .' ' .'
echo `. `-._ _.-' " .' .----.
echo `. " '"--...--"' . ' .' .' o `.
echo .'`-._' " . " _.-'`. : o :
echo .' ```--.....--''' ' `:_ o :
echo .' " ' " " ; `.;";";";'
echo ; ' " ' . ; .' ; ; ;
echo ; ' ' ' " .' .-'
echo ' " " ' " " _.-'
pause
md %userprofile%\cookies
goto MENU

:remhist
echo Oscar The Grouch wants to know where you've been
deltree /y %1\temp\history\*.*
echo Deleting Files
echo File Deleted
pause

goto MENU





sorry about the ascii... i got boared
but this is what i've got at the moment
 
it still won't delete the temporary internet files.
it runs through no messages like it's working, but fails to delete anything in that folder, everytime! i don't get it.
thanks so much for your help... i'm not sure why i am having so much trouble.

@echo off
:Menu
cls
echo.
echo clear temp files
echo. ----------------------------------
echo 1. delete files
echo.
echo 2. EXIT
echo ----------------------------------
set /p choice=Select an Action:

pause

echo %choice%

if %choice%==2 goto EXIT
if %choice%==1 goto user

:menua
@echo off
cls
echo.
echo **********************************************
echo Cookies have been deleted
echo would you like to continue with cleanup?
echo **********************************************
echo.
echo press 1 to continue
echo press 2 for main menu
echo.
set /p choice=please make a selection:

echo %choice%

if %choice%==2 goto MENU
if %choice%==1 goto menub

:menub
@echo off
cls
echo.
echo *******************************************
echo ** This will remove all of the following **
echo ** files for the current user: **
echo *******************************************
echo ** History **
echo ** temp **
echo ** temporary internet files **
echo *******************************************
echo.
echo ARE YOU SURE YOU WISH TO CONTINUE? Y/N
echo.
set /p choice=well:

if %choice%==N goto MENU
if %choice%==Y goto remove
if %choice%==n goto MENU
if %choice%==y goto remove

:EXIT
exit

:remove
del /q /f c:\windows\temp\*.*
cd %userprofile%\Local Settings\Temp
del /q /f *.*
cd %userprofile%\Local Settings\Temporary Internet Files\
del /q /f *.*
cd %userprofile%\Local Settings\History
del /q /f *.*
pause
goto MENU


:USER
pause
cd %userprofile%\Cookies
del /q /f *.*
pause
goto menua
 
I was noticing that too about the temporary internet files. I'll look into it a bit more.

Kinda odd that you and I seem to be the only ones to know a bit about batch files... :p
 
saw that one too... still same problem.
won't delete within the user's profile...
won't move files to another directory to delete either
 
Data Execution Prevention (DEP)
xp sp2 installs something called DEP and i highly suspect that this is what is causing my problems. it would explain why a flawless and very very simple .bat file won't delete within the profile.

here's a MS explanation

Understanding Data Execution Prevention

Data Execution Prevention (DEP) helps prevent damage from viruses and other security threats that attack by running (executing) malicious code from memory locations that only Windows and other programs should use. This type of threat causes damage by taking over one or more memory locations in use by a program. Then it spreads and harms other programs, files, and even your e-mail contacts.

Unlike a firewall or antivirus program, DEP does not help prevent harmful programs from being installed on your computer. Instead, it monitors your programs to determine if they use system memory safely. To do this, DEP software works alone or with compatible microprocessors to mark some memory locations as "non-executable". If a program tries to run code—malicious or not—from a protected location, DEP closes the program and notifies you.

DEP can take advantage of software and hardware support. To use DEP, your computer must be running Microsoft Windows XP Service Pack 2 (SP2) or later, or Windows Server 2003 Service Pack 1 or later. DEP software alone helps protect against certain types of malicious code attacks but to take full advantage of the protection that DEP can offer, your processor must support "execution protection". This is a hardware-based technology designed to mark memory locations as non-executable. If your processor does not support hardware-based DEP, it's a good idea to upgrade to a processor that offers execution protection features.

Is it safe to run a program again if DEP has closed it?

Yes, but only if you leave DEP turned on for that program. Windows can continue to detect attempts to execute code from protected memory locations and help prevent attacks. In cases where a program does not run correctly with DEP turned on, you can reduce security risks by getting a DEP-compatible version of the program from the software publisher. For more information about what to do after DEP closes a program, click Related Topics.

How can I tell if DEP is available on my computer?

To open System Properties, click Start, point to Settings, click Control Panel, and then double-click System.
Click the Advanced tab and, under Performance, click Settings.
Click the Data Execution Prevention tab.
Note

By default, DEP is only turned on for essential Windows operating system programs and services. To help protect more programs with DEP, select Turn on DEP for all programs and services except those I select.
 
Turn off the DEP feature in Windows XP SP2
you can turn off the DEP feature. To do this, follow these steps:
1. Restart your computer.
2. During the restart process, press F8.

Note On a computer that is configured to start multiple operating systems, press F8 when the Startup menu appears.
3. Use the arrow keys to select a Safe Mode option, and then press ENTER.
4. Click Start, click Run, type cmd, and then click OK.
5. At the command prompt, type the following, and then press ENTER:
bootcfg /raw “/noexecute=alwaysoff /fastdetect” /id 1
Note If you have multiple start entries or start options, you may have to manually modify the Boot.ini file for your computer. To do this, follow these steps:
a. Click Start, click Run, type sysdm.cpl, and then click OK.
b. On the Advanced tab, under Startup and Recovery, click Settings.
c. In the Startup and Recovery dialog box, click Edit.
d. Change the /noexecute option to the following:
/noexecute=alwaysoff
e. On the File menu, click Save, and then click Exit.
f. Click OK two times.
6. Restart your computer.


for more information try MS A detailed description of the Data Execution Prevention (DEP) feature in Windows XP Service Pack 2 and Windows XP Tablet PC Edition 2005 this is kb/875352

http://www.microsoft.com/windows/appcompatibility/default.mspx
 
Status
Not open for further replies.
Back
Top Bottom