#29747 - 2002-09-26 07:41 PM
Help with deleteing files in User Profiles
|
NH411
Lurker
Registered: 2002-09-26
Posts: 3
|
Unfortunately I'm less than well versed in Kix Scripting, but here's what I'm trying to accomplish:
I need to delete specific INI files for all users of a workstation in both "Documents and Settings" as well as 95/98 "Windows\Profiles" directories. There is also a copy of the source INI file in "Program files\XYZ".
The Problem I'm running into is that most of the file deletion scripts I've found require you to name the directories your looking in instead of including all subdirectories...
Any ideas or help would be very much appreciated...
Thx, Me
|
Top
|
|
|
|
#29749 - 2002-09-26 07:44 PM
Re: Help with deleteing files in User Profiles
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I have no wintendo to get the parameters of DEL there, however, see the /s switch:
code:
Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp.
C:\>del /? Deletes one or more files.
DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
names Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted.
/P Prompts for confirmation before deleting each file. /F Force deleting of read-only files. /S Delete specified files from all subdirectories. /Q Quiet mode, do not ask if ok to delete on global wildcard /A Selects files to delete based on attributes attributes R Read-only files S System files H Hidden files A Files ready for archiving - Prefix meaning not
If Command Extensions are enabled DEL and ERASE change as follows:
The display semantics of the /S switch are reversed in that it shows you only the files that are deleted, not the ones it could not find.
C:\>
|
Top
|
|
|
|
#29751 - 2002-09-26 07:50 PM
Re: Help with deleteing files in User Profiles
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
it is a sad day when lazy admins are too lazy to script....
|
Top
|
|
|
|
#29753 - 2002-09-26 07:59 PM
Re: Help with deleteing files in User Profiles
|
NH411
Lurker
Registered: 2002-09-26
Posts: 3
|
I have a working NT Shell script that deletes the INI files with a "%UserProfile% variable, unfortunately 95/98 doesn't support any Profile or Username variable. I need to delete the specific INI files and not the entire profile directory, the INI file is not referenced in the Registry.
|
Top
|
|
|
|
#29756 - 2002-09-26 08:31 PM
Re: Help with deleteing files in User Profiles
|
NH411
Lurker
Registered: 2002-09-26
Posts: 3
|
BTW, Don't confuse Laziness with applying One's time wisely.
|
Top
|
|
|
|
#29757 - 2002-12-05 07:38 AM
Re: Help with deleteing files in User Profiles
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
FYI about W9x environment.
The beste way of deleting an INI file in a W9x environment is by using deltree. It is fast and search through all directories. Possible share-violations errors are skipped. INI files are always available and are always reachable. Only the registry in- formation HKCU isn't available during logging on. Not available registry means that your changes made by a logging on kixtart script will be gone, when logging on process has been completed.
Very important to known about deltree command is:
a file with same filemask specification must be available in starting directory. So when you are trying to delete f.e. kixtart.ini which is located somewhere in the c:\windows directory you had to entry following commands in your BATch file
code:
@echo off chdir c:\windows c: echo -dummy- >c:\windows\kixtart.ini deltree /y c:\windows\kixtart.ini >nul @echo off
Of course it can be implemented also as a kixtart script.
By using roaming profiles we advice you to run the command also on your server(s) during a lazy moment in the night, when this INI file exists in some of them. greetings.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|