#124718 - 2004-08-11 12:18 PM
Re: Logon script for deleting local user's temp files
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
AFAIK KiXtart DEL won't delete files from subdirectories (the "/S" flag means delete system files) so if you really mean that you want to delete *.tmp files from anywhere on the drive you will need to use the DOS DEL built-in:
Code:
Shell '"%COMSPEC%" /C DEL /S /F C:\*.TMP'
NB, I checked this using DOS DIR, and it matched suffixes such as ".tmpl" which start .tmp, so be careful.
The problem is that this will take a very long time to run, unless you can limit the scope of the search.
|
|
Top
|
|
|
|
#124720 - 2004-08-11 03:21 PM
Re: Logon script for deleting local user's temp files
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
By narrowing the scope of the search, do you mean narrowing down exactly what directory path the temp files are located?
Yes.
Quote:
Could I do multiple paths?
Yes. Either repeat the command for each directory, or specify multiple paths with the command.
If the files that you are looking for are always created in the Windows temp directory it may be simpler to use the environment variable %TEMP% to locate it.
The best solution however will depend on the operating systems you need to support, and what you are actually trying to do.
I get the impression that you are a bit unsure exactly what it is you are trying to do. I know I am. Post a little more information, including:
- What are these "*.tmp" files?
- What creates them?
- Why do you think you need to remove them during the login process?
- What versions of Windows does the script need to run on?
- What version of KiXtart are you using?
- What else can you tell us that will help us give you the best solution?
|
|
Top
|
|
|
|
#124725 - 2004-08-11 05:00 PM
Re: Logon script for deleting local user's temp files
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Agree with Richard's points as well.
Here is a link to the UDF though that I think Les was referring to.
CleanDirectory() - Cleans up the temporary directories (or any arbitrary directory) http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=82117
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|