Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-06-2005, 04:18 PM   #1 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default quick question

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

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

thanks in advance
__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-06-2005, 08:02 PM   #2 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default

bump ;D
__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-07-2005, 01:01 AM   #3 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

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

EL
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.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 01-07-2005, 08:26 AM   #4 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default

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.
__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-07-2005, 09:15 AM   #5 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

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:
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 01-07-2005, 09:41 AM   #6 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default

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...
__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-07-2005, 09:50 AM   #7 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default

no errors, just this

__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-07-2005, 12:51 PM   #8 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

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.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 01-07-2005, 12:59 PM   #9 (permalink)
 
Ultra Techie

Join Date: Oct 2004

Posts: 600

Roshi229

Send a message via AIM to Roshi229 Send a message via Yahoo to Roshi229
Default

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..
__________________
http://www.kbdigisol.com

<form action=\"http://www.srsyo.org/tfsearch.php\" method=\"get\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" name=\"submit\" value=\"Search first, ask later!\"></form>
powered by emily .
Roshi229 is offline  
Old 01-07-2005, 01:01 PM   #10 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

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.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On