quick question

Status
Not open for further replies.

Roshi229

Daemon Poster
Messages
595
i'm tempting fate with deltree at the moment.
i need to delete cookies, but under individual users
i need a line for my .bat file that will allow my to input of "NTID" assign it to %1 (i think that's right
and recall it on the next line... i've found something that told me how, but i don't get what it's saying...

so that it would look something like this () signifies my confusion

echo enter user's NTid
(how to prompt) (input required) (assign to %1)
goto DEL

:DEL
deltree /y C:\Documents and Settings\(%1)\Cookies\*.*

thanks in advance
 
I don't have a PC to test this on at the moment, but try this on for size

First, I'd recommend a text based variable, rather than the number 1

set var=0
set /p var=Enter your User Name:
goto DEL

:DEL
deltree /y C:\Documents and Settings\%var%\Cookies\*.*

I'll find out specifically for you tomorrow at work, when I'm back at my PC.
 
thanks bla!!
still not working fully... it is asking the name but still says "the system cannot find the path specified"

here's what i got... so far
:MENU
@echo off
cls
echo.
echo clear temp files
echo. ----------------------------------
echo 1. delete files
echo.
echo 2. EXIT
echo ----------------------------------
choice /c:12 " SELECT AN ACTIVITY

if errorlevel ==2 goto EXIT
if errorlevel ==1 goto user

:EXIT
exit

:remove
deltree /y c:\windows\temp\*.*
pause

:USER
set var=0
set /p var=Enter your User Name:
cd\cookeis
deltree /y C:\Documents and Settings\%var%\Cookies\*.*
goto remove


the pause was added in there so that i could debug a bit... and read what it was doing before it went away. it will be removed later.
this is what it is atm... it has changed over and over... i've tried to cd\ to the folder i've tried everything i can think of...
if i can get past this hurdle i'll be off and running.

i am doing this b/c there is a major spyware problem on our netowork, this will enable us to rapidly clean many systems when it's done. or add to the logon script so that users are forced to clean the system every morning.

thanks.
 
Is it giving you any errors? Also what OS are you testing this on?

doing cd C:\Documents and Settings\%var%\Cookies works on XP Pro here at my office.

Also I just stumbled across something. Deltree is an outdated command and is not included with WinXP or 2k.

Instead if you just want to delete the files within the cookies folder, just use the del command. (Only downside would be if there's any folders within the Cookies folder).

Also, do you know if the variable is being set correctly? Try adding ECHO %var% under this line set /p var=Enter your User Name:
 
yes it's win XP pro
and deltree has been working fine so far, the only problem is getting it to navigate to the cookie folder...
let me ask you this, can i include something like this, and i'm not sure if my syntax is correct or not, but
%username% to recognise current loged on user?


edit, just tried echo %var% and it's showing it as username...
 
no errors, just this
script.bmp
 
Ohh, that's because you have this line in your Code
Code:
cd\cookies

I'm not even sure what you wanted to do with that, but it's not a vaild directory. Get rid of it and your errors should be history.

And yeah, I forgot that windows sets %username% when you log in. You can use that and get rid of the line prompting the user.
 
lol great,
yeah that was a BFO (blinding flash of the Obviouse)

i'll post the updated version here in a few... it runs, no errors, but when i check mycomputer, nothing has been deleted.

i'm stumped..
 
I have a quick question for you. Would you type echo %path% and post what you have on here?

You have access to more commands that I do in your dos environment. Like mine doesn't have deltree or choice.
 
Status
Not open for further replies.
Back
Top Bottom