Ok, here is what your looking for
@ECHO OFF
if exist %systemdrive%\date.txt for /f "tokens=1,2,3 delims=/" %%a in (%systemdrive%\date.txt) do set mydate=%%a/%%b/%%c
if NOT exist %systemdrive%\date.txt GOTO Choices
set run=False
date /t|Find "%mydate%">nul
IF NOT ERRORLEVEL 1 set run=true
if %run% == true goto CLEANTEMP
if %run% == False goto exit
:Choices
ECHO.
echo ษออออออออออออออออออออออออออออออออออป
echo บ TEMP File Remover บ
ECHO บ By Skate_Punk_21 บ
echo ฬออออออออออออออออออออออออออออออออออน
echo บ 1. Set Date to Run บ
echo บ 2. run Cleaner Now บ
echo บ E. Exit without making changes บ
echo ศออออออออออออออออออออออออออออออออออผ
ECHO.
set /p Choice={1,2,E}
if '%Choice%'=='e' GOTO exit
if '%Choice%'=='E' GOTO exit
IF '%Choice%'=='1' GOTO SetRun
IF '%Choice%'=='2' GOTO CLEANTEMP
IF '%Choice%'=='' GOTO exit
GOTO exit
:CLEANTEMP
attrib -s -r -h %systemdrive%\temp\*.*
del /q %systemdrive%\temp\*.*
cls
GOTO Choices
:SetRun
if exist %systemdrive%\date.txt del C:\date.txt
set /p newDate={dd/mm/yyyy}
echo %newDate%>>%systemdrive%\date.txt
ECHO Date Set!
ECHO REGEDIT4>>%systemdrive%\reg.reg
ECHO.>>%systemdrive%\reg.reg
ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]>>%systemdrive%\reg.reg
ECHO "Punks Temp Cleaner!"="%cd%\clean.bat">>%systemdrive%\reg.reg
regedit /s %systemdrive%\reg.reg
pause
del %systemdrive%\reg.reg
cls
GOTO Choices
:exit
exit
Blurb:You run it the first time, from whatever directory it will stay in. Once you set the date it should run on, it will edit the registry and run on startup with your computer. If, at the time of running, it is the correct day (as dictated by a text file) it will empty C:\temp\ and present you with the option to set the next date of running. If it is NOT the correct day for temp file cleaning it will close and you'll see nothing.
NOTE: at this line
ECHO "Punks Temp Cleaner!"="%cd%\clean.bat">>%systemdrive%\reg.reg
you'll need to change
clean.bat with whatever you will call the file.
and probably in a better language than batch scripting, as the others have said...
Better language?!
no wayyyyy!
<edit> thats nice code, i might have to copyright it
</edit>
Edited by skate_punk_21, 06 May 2006 - 11:21 PM.