Sorry I forgot to mention I am writing a Batch file and wish to determine what the windows type is , as the location of files is different on xp/vista
example here
@TITLE AnyNew by HighlandElectrix(TV)
@echo off
@mode con:cols=90 lines=20
rem this program will find where your cookies are stored (xp/Vista) and then look at each one and let you choose
rem whether to Keep or Delete it, if you keep it, a copy will be stored in a folder c:\goodcookies, so that next
rem time its found it will be ignored, also any cookies you choose to delete will be moved to c:\badcookies
rem and if found again will be deleted autometically. Hope you like it (freeware (c) Eddie Duncan-Dunlop 2010)
rem if you accidentally delete a good cookie, the go to the badcookies folder and cut/paste to goodcookies, or reverse
rem if you make a mistake, you can open the c:\badcookies or c:\goodcookies and correct the error
rem only designed for Internet Explorer
set version=v1.23.bat
echo (c) Eddie Duncan-Dunlop 2010 Version %version%
color E0
rem E=bright yellow 0=Black
rem set the path to where all cookies are stored (vista is different)
set thepath="%userprofile%\cookies\"
rem -------------------- make sure its not Vista----------------------------------------------------------
if not exist %windir%\help\comexp.chm (
echo NOT WinodwsXP
pause)
if exist %windir%\system32\ndfetw.dll (
echo Vista this is the XP version
pause
set %thepath%="%AppData%\Microsoft\Windows\cookies\")
echo path is %thepath%
rem make a place to store the good/bad cookies if not already there--------------------------------
if not exist %systemdrive%\goodcookies (
md %systemdrive%\goodcookies
echo this is a list of good cookies that will left alone >%systemdrive%/goodcookies/AnyNew.inf
)
if not exist %systemdrive%\badcookies (
md %systemdrive%\badcookies
echo this is a list of bad cookies that will deleted automatically >%systemdrive%/badcookies/AnyNew.inf
)
rem --------------- make a small batch file to call for each cookie ---------------------------------------------
if exist %systemdrive%\%version% goto itsthere
echo if exist %%systemdrive%%\goodcookies\%%1 goto bye>%systemdrive%\%version%
if errorlevel 4 pause
echo if exist %%systemdrive%%\badcookies\%%1 set _what="d">>%systemdrive%\%version%
echo if exist %%systemdrive%%\badcookies\%%1 goto here>>%systemdrive%\%version%
echo set /P _what= %%1 Delete [D/enter] or Keep[K] .>>%systemdrive%\%version%
echo If /i "%%_what%%"=="" set _what="d">>%systemdrive%\%version%
echo If /i "%%_what%%"== "D" set _what="d">>%systemdrive%\%version%
echo If /i "%%_what%%"== "K" set _what="k">>%systemdrive%\%version%
echo If /i "%%_what%%" == ""k"" copy /y %%1 %systemdrive%\goodcookies\%%1^>nul >>%systemdrive%\%version%
echo If /i "%%_what%%" == "k" copy /y %%1 %systemdrive%\goodcookies\%%1^>nul >>%systemdrive%\%version%
echo :here >>%systemdrive%\%version%
echo If /i "%%_what%%" == ""d"" move /y %%1 %systemdrive%\badcookies\%%1^>nul >>%systemdrive%\%version%
echo :bye >>%systemdrive%\%version%
rem ----------------- its there -----------------------------
:itsthere
rem ---------- store the current path to folder and call the little bat file for each cookie found -------------
pushd %thepath%
for %%n in (*.txt) do (
call %systemdrive%\%version% %%n %thepath%
)
popd
rem ECHO
echo Closing in 6 Seconds
for /l %%A in (1,1,6) do (
<nul (set/p z=%%A )
>nul ping 127.0.0.1 -n 2
)
echo.
rem ----- delete all the bad cookies as listed in folder from the normal storage place -----------------------
pushd %systemdrive%\badcookies
for %%n in (*.txt) do if exist %thepath%\%%n del %thepath%\%%n
popd
rem only need to keep the filename(not the contents) so shorten them to "MT" to save room on Hdrive
for %%n in (%systemdrive%\badcookies\*.txt) do echo MT>%%n
for %%n in (%systemdrive%\goodcookies\*.txt) do echo MT>%%n
set thepath=
set _what=
exit