Delete everything except command - for profile deletion?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to run a command or script which will delete everything in a
folder, except a few exception folders?

The reason I ask is that I would like users profiles to be deleted from the
local computer when they log out. I was thinking I would just put this as a
logout script to remove all folders in the C:\Documents and Settings except
Administrator, Default User, and All Users folder.

The reason for this deleting of profiles is because there are a large number
of users using these computers and very limited hard disk space, in addition
to some problems with them relogging in and having their profile already
there. Thank you for any help.
Jason
 
How To Assign a Mandatory User Profile in Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;307800

--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User
Microsoft Newsgroups

Be Smart! Protect Your PC!
http://www.microsoft.com/athome/security/protect/default.mspx

------------------------------------------------------------------------------

:

| Is there a way to run a command or script which will delete everything in a
| folder, except a few exception folders?
|
| The reason I ask is that I would like users profiles to be deleted from the
| local computer when they log out. I was thinking I would just put this as a
| logout script to remove all folders in the C:\Documents and Settings except
| Administrator, Default User, and All Users folder.
|
| The reason for this deleting of profiles is because there are a large number
| of users using these computers and very limited hard disk space, in addition
| to some problems with them relogging in and having their profile already
| there. Thank you for any help.
| Jason
 
=?Utf-8?B?SmFzb24gUnlvbg==?= said:
The reason for this deleting of profiles is because there are a large number
of users using these computers and very limited hard disk space, in addition

Work the problem. ie hard drive space. ie dont use software to fix a
hardware problem. ie get larger drives.
 
The problem with this method is that this is for a lab environment, which
contains 50 computers. This would mean we would need to spend 5000$ to
upgrade the hard drives, when a simple bit of code which will remove old
profiles would suffice. In addition, this is just a temporary fix, and we
will eventually be replacing this lab with more modern equipment, probably
within the next year, so we are remeding this situation, but the users still
need to be able to use the current systems until this happens.
Beaurocratcy...

Thanks for your suggestion however,
Jason
 
Jason said:
Is there a way to run a command or script which will delete
everything in a folder, except a few exception folders?

The reason I ask is that I would like users profiles to be deleted
from the local computer when they log out. I was thinking I would
just put this as a logout script to remove all folders in the
C:\Documents and Settings except Administrator, Default User, and
All Users folder.
Hi

You can use Delprof.exe, as long as it is ok that the Administrator
profile is deleted (no big deal really, it will be recreated
automatically when you log on with the Administrator account, getting
the settings from the Default User profile").

If you run the command "Delprof.exe /Q", it will delete all existing
profiles on a computer (but not the profile of the user that runs
Delprof).

It will not touch any other folders in the "C:\Documents and Settings"
folders, such as "All Users", "Default User, "LocalService" and
"NetworkService", it will only delete "real" user profiles.


Delprof.exe is in the free Windows Server 2003 Resource Kit:

http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

(The kit will install on WinXP or later, the individual files can
then be copied to other computers if needed)
 
Is it possible to have delprof.exe run using administrator's credentials,
during the logoff, such as a logoff script? One thing I'm having problems
with is passing a password to the runas in a script. I've heard there is a
runas+ which will allow passwords to be coded into scripts, but can't seem to
find this anywhere on google. If I did get it to run as an administrator
during the users logoff, would it still attempt to delete the admin's
profile?

Thanks again,
Jason
 
Jason said:
Is it possible to have delprof.exe run using administrator's
credentials, during the logoff, such as a logoff script? One
thing I'm having problems with is passing a password to the runas
in a script. I've heard there is a runas+ which will allow
passwords to be coded into scripts, but can't seem to find this
anywhere on google. If I did get it to run as an administrator
during the users logoff, would it still attempt to delete the
admin's profile?
Hi

If the RunAs application loads the Administrator profile, I would think
that delprof.exe would not delete it (because it is then "in use").

Different RunAs products listed here, some with encryption
option for the password:

http://groups.google.com/[email protected]

Other ones not mentioned in the link above:

LSrunas/LSrunasE (the latter with password encryption)
http://www.linkselection.com/lsrunas.asp

SUperior SU
http://www.stefan-kuhr.de/supsu/main.php3

You may also want to check NeoExec ( http://www.neovalens.com ),
the main difference is that it does not require the use of a second
account, as all RunAs derivatives requires.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top