#113711 - 2004-02-10 03:24 PM
Delete the temp files AND subdirectories
|
Babbage
Fresh Scripter
Registered: 2004-02-10
Posts: 8
|
Hello world.
I am trying to delete the temp files from XP/Win2000 network nodes. It is working except for the Subdirectories.
Code:
$tempsht="%temp%" $tempsht = $tempsht+"\*.* /s" del $tempsht
Thanks In Advance People!
|
|
Top
|
|
|
|
#113713 - 2004-02-10 03:37 PM
Re: Delete the temp files AND subdirectories
|
Babbage
Fresh Scripter
Registered: 2004-02-10
Posts: 8
|
Tried it both ways Les.
No Deal.
del "filename" /s /h
Where filename = "c:\temp\*.*"
also
Where filename = "c:\temp\*.* /s"
Code:
$tempsht="%temp%"
$tempsht = $tempsht+"\*.*"
del $tempsht /s
No Subs get deleted.
Seems like a pretty simple request, do you delete user temp files at network logon?
If yes, lets see the code. BTW I need to use %temp% I'm not running windows 95 anymore....
|
|
Top
|
|
|
|
#113717 - 2004-02-10 04:11 PM
Re: Delete the temp files AND subdirectories
|
Babbage
Fresh Scripter
Registered: 2004-02-10
Posts: 8
|
(Laughs) Too much time? That is the whole point of Kix is to automate function. Why walk around to 50 machines when you should be able to do it with three lines of code. And you are a Kix moderator???? 
If you don't care about the local machine you're really not much of a Network administrator are you? (Me thinks you aren't anyway)
That's simply foolish. Try this, click start Run, in the blank type in CMD, then when the dos window appears type in "CD %temp%" (without the quotes) now type "dir /s /p" (without quotes) look at all of the garbage you are keeping on your system... If you get enough files here the computer will not work correctly anymore.
|
|
Top
|
|
|
|
#113722 - 2004-02-10 07:22 PM
Re: Delete the temp files AND subdirectories
|
Babbage
Fresh Scripter
Registered: 2004-02-10
Posts: 8
|
Quote:
I don't bother with LUser's temp files either. They get deleted whenever we scrub and re-image thier computers.
Gee you are right, why fix the door when you can just rebuild the whole house, that's much more efficient. Bonus: It keeps you from really knowing how to fix anything... (this is starting to show)
Quote:
There are times when stuff should not be deleted from their %temp% folder because it is there for a reason.
Oh Really? And what reason is that? At Startup the Temp is not used. You install something, it gets unpacked in %temp%, gets installed, and you need to reboot. The files are left there, and what a better time to delete them than at Network startup?
Quote:
...now if you had some intelligence behind the delete to only get rid of stuff say, a month old. Hmmm... didn't someone write a UDF to do that?
I found a bug in KIX (DEL does not remove Sub Dirs) and you say there is a UDF for it, then you want a rationale to use a funciton that does not work as expected, as documented, as it should.
Thanks for your OPINIONS, I'm expecting some kind of non-specific reply again based on an incorrect assumption or your opinion containing no evidence.
|
|
Top
|
|
|
|
#113723 - 2004-02-10 07:32 PM
Re: Delete the temp files AND subdirectories
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
Quote:
I found a bug in KIX (DEL does not remove Sub Dirs)
Why is this supposed to be a bug? The KiXtart Manual clearly states that DEL applies ONLY to files, there's no mention of removing folders, which, BTW, is beign done via RD.
Quote:
Del
Action: Deletes one or more files.
RD
Action: Removes the directory specified.
Quote:
you say there is a UDF for it, then you want a rationale to use a funciton that does not work as expected, as documented, as it should.
And would you please mind explaining what is wrong with the UDF? Why does it not work as expected, or as documented?
Edited by sealeopard (2004-02-10 07:34 PM)
_________________________
There are two types of vessels, submarines and targets.
|
|
Top
|
|
|
|
#113730 - 2004-02-10 08:41 PM
Re: Delete the temp files AND subdirectories
|
Babbage
Fresh Scripter
Registered: 2004-02-10
Posts: 8
|
The more one knows the more one realizes one does not know.
This is what I said: Quote:
Gee Les, you seem to have complete knowledge so I won't waste your time.
lol
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2924 anonymous users online.
|
|
|