Page 1 of 1 1
Topic Options
#156870 - 2006-02-07 08:26 PM delete all temporary files
Ulrich Offline
Fresh Scripter

Registered: 2005-08-19
Posts: 6
Hallo,

I´m a newbie in kix. I want to delete all temporary files in

C:\Dokumente und Einstellungen\UserID\Lokale Einstellungen\Temp

how can I do this?

Thanks,

U. Eckerle

Top
#156871 - 2006-02-07 09:24 PM Re: delete all temporary files
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Something like this should work, but there are UDF scripts for this that allow more control of what or when items are deleted.

Code:
If Len('%temp%\')>5
DEL '%TEMP%\*.*' /c /f /h /s
EndIf


Top
#156872 - 2006-02-08 04:29 PM Re: delete all temporary files
Ulrich Offline
Fresh Scripter

Registered: 2005-08-19
Posts: 6
Something does not work.



If Len('%temp%\')>5
DEL '%TEMP%\*.tmp' /c /f /h /s
EndIf


Top
#156873 - 2006-02-08 07:07 PM Re: delete all temporary files
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
and I don't have a chick next to me.
gladly I have beer in the freezer though.

anyways, surely "something does not work" does not help anyone.

add some code checking why it does not do what you want it to do.
there is a if clause. add else.
after del, you might add @error or even @result line, etc...
_________________________
!

download KiXnet

Top
#156874 - 2006-02-08 07:44 PM Re: delete all temporary files
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Okay, please run this code and post back exactly what it returns.

Break On
If @KiX
'KiXtart ver: ' + @KiX ?
Else
'woah we have a problem' ?
EndIf
If Len('%temp%\')>5
'Temp is longer than 5 characters' ?
'Temp folder is: ' + '%TEMP%\' ?
DEL '%TEMP%\*.*' /c /f /h /s
'Removing files gave error: ' + @ERROR + ' ' + @SERROR ??
'Note that if there are no more files in MAIN TEMP directory ' ?
'then you will get an ERROR 2 which is normal' ?
'Using the /s switch will return an ERROR 2 if there are no more files as well' ?
'in the sub-directories of the TEMP folder'?
Else
'Odd for some reason TEMP path is too short' ?
EndIf

 

Top
#156875 - 2006-02-08 08:11 PM Re: delete all temporary files
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Just wondering what sort of *sanity check* the If @KiX is?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.061 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org