How to delete a folder tree at boot time?

Archived from groups: microsoft.public.win2000.general,comp.os.ms-windows.misc (More info?)

I have a folder tree on my harddisc which I cannot delete during a normal Win2000 session.
When I tried it I got a dialog popup

"Cannot remove folder xxx: Access is denied. The source file may be in use."

I am pretty sure that no program is using it. Even after a reboot it is locked.

So my last hope to get rid of this trash is to delete this directory tree at boot time
when the mysterious program has not already locked the files inside the tree.

How do I do this?
Imagine I have a simple MSDOS batch file with the delete commands inside.
How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?


Paul
9 answers Last reply
More about delete folder tree boot time
  1. Archived from groups: microsoft.public.win2000.general (More info?)

    After backup you might try running;
    chkdsk /r
    from the recovery console command line. (/r implies /f and /p)

    To start the Recovery Console, start the computer from the Windows 2000
    Setup CD or the Windows 2000 Setup floppy disks. If you do not have Setup
    floppy disks and your computer cannot start from the Windows 2000 Setup CD,
    use another Windows 2000-based computer to create the Setup floppy disks. At
    the "Welcome to Setup" screen. Press F10 or R to repair a Windows 2000
    installation, and then press C to use the Recovery Console. The Recovery
    Console then prompts you for the administrator password. If you do not have
    the correct password, Recovery Console does not allow access to the
    computer. If an incorrect password is entered three times, the Recovery
    Console quits and restarts the computer. Note If the registry is corrupted
    or missing or no valid installations are found, the Recovery Console starts
    in the root of the startup volume without requiring a password. You cannot
    access any folders, but you can carry out commands such as chkdsk, fixboot,
    and fixmbr for limited disk repairs. Once the password has been validated,
    you have full access to the Recovery Console, but limited access to the hard
    disk. You can only access the following folders on your computer: drive
    root, %systemroot% or %windir%

    Also you can try deleting from the recovery console. First you'll need to
    Control Panel|Admin Tools|Local Security Policy Recovery console:"Allow
    floppy copy and access to all drives/folders" set to enabled

    Then from the recovery console command line;
    SET allowallpaths = TRUE

    to gain access to all folders and try deleting from here.


    --
    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect

    "Sven Mayer" wrote:
    |I have a folder tree on my harddisc which I cannot delete during a normal
    Win2000 session.
    | When I tried it I got a dialog popup
    |
    | "Cannot remove folder xxx: Access is denied. The source file may be in
    use."
    |
    | I am pretty sure that no program is using it. Even after a reboot it is
    locked.
    |
    | So my last hope to get rid of this trash is to delete this directory tree
    at boot time
    | when the mysterious program has not already locked the files inside the
    tree.
    |
    | How do I do this?
    | Imagine I have a simple MSDOS batch file with the delete commands inside.
    | How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?
    |
    |
    | Paul
    |
  2. Archived from groups: microsoft.public.win2000.general (More info?)

    On 17 Jul 2005 11:26:43 GMT, hamiltonx@lycos.com (Sven Mayer) wrote:

    >I have a folder tree on my harddisc which I cannot delete during a normal Win2000 session.
    >When I tried it I got a dialog popup
    >
    >"Cannot remove folder xxx: Access is denied. The source file may be in use."
    >
    >I am pretty sure that no program is using it. Even after a reboot it is locked.
    >
    >So my last hope to get rid of this trash is to delete this directory tree at boot time
    >when the mysterious program has not already locked the files inside the tree.
    >
    >How do I do this?
    >Imagine I have a simple MSDOS batch file with the delete commands inside.
    >How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?
    >
    >
    >Paul


    Boot the Recovery Console and delete it.
    See tip 2037 » What can I do with the Windows 2000 Recovery Console?
    in the 'Tips & Tricks' at http://www.jsifaq.com
  3. Archived from groups: microsoft.public.win2000.general (More info?)

    Hello,

    In article <42da4073$0$25328$9b4e6d93@newsread2.arcor-online.net>,
    hamiltonx@lycos.com says...
    > I have a folder tree on my harddisc which I cannot delete during a normal Win2000 session.
    > When I tried it I got a dialog popup
    >
    > "Cannot remove folder xxx: Access is denied. The source file may be in use."
    >
    > I am pretty sure that no program is using it. Even after a reboot it is locked.

    Please note there are several directories locked by windows. Windows
    thinks it can not run without these directories. The Outlook Express
    directory is one example, even if you uninstalled OE. If you remove this
    directory, it will be re-created by windows next boot.

    >
    > So my last hope to get rid of this trash is to delete this directory tree at boot time
    > when the mysterious program has not already locked the files inside the tree.
    >
    > How do I do this?
    > Imagine I have a simple MSDOS batch file with the delete commands inside.
    > How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?

    Add your batch file to

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

    >
    >
    > Paul
    >
    >

    --

    h.wulff
    [dont send me an email]
  4. Archived from groups: microsoft.public.win2000.general (More info?)

    Hi Sven - From my Blog, Defending Your Machine, addy in Signature below:


    "Sometimes the tools below will find files which they are unable to delete
    because they are in use.

    A program called Copylock, here, http://noeld.com/programs.asp?cat=misc can
    aid in the process of "replacing, moving, renaming or deleting one or many
    files which are currently in use (e.g. system files like comctl32.dll, or
    virus/trojan files.)"

    Another is Killbox, here: http://www.downloads.subratam.org/KillBox.zip

    A third which is a bit different but often very useful is Delete Invalid
    File, here: http://www.purgeie.com/delinv.htm which handles invalid/UNC
    file/folder name deleting, rather than the in use problem.

    A fourth useful program is Unlocker, here:
    ..http://ccollomb.free.fr/unlocker/ " Simply right click the folder or file
    and select Unlocker. If the folder or file is locked, a window listing of
    lockers will appear. Simply select the lockers and click Unlock and you are
    done!" Works as advertised and is particularly helpful in identifying
    malware components which are 'protecting' each other."


    --
    Regards, Jim Byrd, MS-MVP
    My Blog, Defending Your Machine, here:
    http://defendingyourmachine.blogspot.com/

    "Sven Mayer" <hamiltonx@lycos.com> wrote in message
    news:42da4073$0$25328$9b4e6d93@newsread2.arcor-online.net
    > I have a folder tree on my harddisc which I cannot delete during a
    > normal Win2000 session. When I tried it I got a dialog popup
    >
    > "Cannot remove folder xxx: Access is denied. The source file may be
    > in use."
    >
    > I am pretty sure that no program is using it. Even after a reboot it
    > is locked.
    >
    > So my last hope to get rid of this trash is to delete this directory
    > tree at boot time when the mysterious program has not already locked
    > the files inside the tree.
    >
    > How do I do this?
    > Imagine I have a simple MSDOS batch file with the delete commands
    > inside.
    > How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?
    >
    >
    > Paul
  5. Archived from groups: microsoft.public.win2000.general (More info?)

    I suggest having a very DOS knowledgeable person do this for you.

    I suggest doing each command one at a time until the files of interest
    are gone. Unless very knowledgeable in DOS and .BAT

    Learn these DOS commands on the internet. each line below is one
    command.

    cd
    dir /p
    sys
    Del
    Attrib [and all of the switches]
    rmdir
  6. Archived from groups: microsoft.public.win2000.general (More info?)

    quoting:
    > I have a folder tree on my harddisc which I cannot delete during a normal
    Win2000 session.
    > When I tried it I got a dialog popup
    >
    > "Cannot remove folder xxx: Access is denied. The source file may be in
    use."
    >
    > I am pretty sure that no program is using it. Even after a reboot it is
    locked.
    >
    > So my last hope to get rid of this trash is to delete this directory tree
    at boot time
    > when the mysterious program has not already locked the files inside the
    tree.
    >
    > How do I do this?
    > Imagine I have a simple MSDOS batch file with the delete commands inside.
    > How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?
    >
    >
    > Paul


    I do things like that in DOS. That left over DOS from Windows 98 comes in
    handy when you need it. I even made my machine triple boot win2k, win98,
    and dos, so I don't even have to insert a boot disk.
  7. Archived from groups: microsoft.public.win2000.general (More info?)

    hamiltonx@lycos.com (Sven Mayer) wrote:

    >I have a folder tree on my harddisc which I cannot delete during a normal Win2000 session.
    >When I tried it I got a dialog popup
    >
    >"Cannot remove folder xxx: Access is denied. The source file may be in use."
    >
    >I am pretty sure that no program is using it. Even after a reboot it is locked.
    >
    >So my last hope to get rid of this trash is to delete this directory tree at boot time
    >when the mysterious program has not already locked the files inside the tree.
    >
    >How do I do this?
    >Imagine I have a simple MSDOS batch file with the delete commands inside.
    >How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?
    >
    >
    >Paul

    It could be that the folder in question has a file with a bad file name. Renaming
    the filename to something more palatable could make it deleteable.
  8. Archived from groups: microsoft.public.win2000.general (More info?)

    Sven Mayer wrote:
    > I have a folder tree on my harddisc which I cannot delete during a
    > normal Win2000 session. When I tried it I got a dialog popup
    >
    > "Cannot remove folder xxx: Access is denied. The source file may be
    > in use."
    >
    > I am pretty sure that no program is using it. Even after a reboot it
    > is locked.
    >
    > So my last hope to get rid of this trash is to delete this directory
    > tree at boot time when the mysterious program has not already locked
    > the files inside the tree.
    >
    > How do I do this?
    > Imagine I have a simple MSDOS batch file with the delete commands
    > inside.
    > How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?

    If 2000 has an autoexec.bat put it there - del name_of_folder
  9. Archived from groups: microsoft.public.win2000.general (More info?)

    John of Aix <j.murphy@libertysurf.fr> wrote:
    > Sven Mayer wrote:
    >> I have a folder tree on my harddisc which I cannot delete during a
    >> normal Win2000 session. When I tried it I got a dialog popup
    >>
    >> "Cannot remove folder xxx: Access is denied. The source file may be
    >> in use."
    >>
    >> I am pretty sure that no program is using it. Even after a reboot it
    >> is locked.
    >>
    >> So my last hope to get rid of this trash is to delete this directory
    >> tree at boot time when the mysterious program has not already locked
    >> the files inside the tree.
    >>
    >> How do I do this?
    >> Imagine I have a simple MSDOS batch file with the delete commands
    >> inside.
    >> How do I tell Win2000 "perform this file at next reboot" ONCE (!!!) ?

    > If 2000 has an autoexec.bat put it there - del name_of_folder

    Win 2K doesn't use autoexec.bat for anything other than setting some
    environment variables -- if that option is enabled. Commands are never
    executed from there. In order to have the batch run at startup, you'll
    have to make an entry in
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce.

    --
    Gary L. Smith gls432@yahoo.com
    Columbus, Ohio
Ask a new question

Read More

Boot Windows