Folder deletion option on boot bat


  1. Posts : 29
    windows 10 pro
       #1

    Folder deletion option on boot bat


    Can someone please help?
    I need to boot my computer and when its booted, automatically delete a foler. Can anyone make a bat or direct me to some software that can delete my chosen folder.

    C:\Program Files (x86)\BlahBlahBlah\DeleteFolder\anyfilesinfoldertoo <= example

    thankyou
    Attached Thumbnails Attached Thumbnails Folder deletion option on boot bat-windowsversion.jpg  
      My Computer


  2. Posts : 8,111
    windows 10
       #2

    You just need


    RD /S "C:\demo documents\work"

    Add /q if you want it quite is no confirmation
      My Computer


  3. Posts : 7,607
    Windows 10 Home 20H2
       #3

    Batch/CMD script.
    Code:
    RmDir /s /q "C:\Program Files (x86)\BlahBlahBlah\DeleteFolder"

    VBScript.
    Code:
    CreateObject("Scripting.FileSystemObject").DeleteFolder ("C:\Program Files (x86)\BlahBlahBlah\DeleteFolder")
      My Computer


  4. Posts : 29
    windows 10 pro
    Thread Starter
       #4

    Matthew Wai said:
    Batch/CMD script.
    Code:
    RmDir /s /q "C:\Program Files (x86)\BlahBlahBlah\DeleteFolder"


    VBScript.
    Code:
    CreateObject("Scripting.FileSystemObject").DeleteFolder ("C:\Program Files (x86)\BlahBlahBlah\DeleteFolder")

    Thankyou. How do I make a VBScript?....I can make a bat file, but never tried the other. Thank you for helping
      My Computer


  5. Posts : 7,607
    Windows 10 Home 20H2
       #5

    Right-click on the Start button-->Windows PowerShell (Admin). Run the following commands:

    CMD
    Notepad "%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp\Silencious.vbs"

    Click on "Yes" in the pop-up dialog box.
    Copy and paste the VBScript commands into it and save the file.

    You may add the following command atop the file.

    On Error Resume Next

    You won't see an error message even if "C:\Program Files (x86)\BlahBlahBlah\DeleteFolder" does not exist.
      My Computer


  6. Posts : 29
    windows 10 pro
    Thread Starter
       #6

    Matthew Wai said:
    Right-click on the Start button-->Windows PowerShell (Admin). Run the following commands:

    CMD
    Notepad "%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp\Silencious.vbs"

    Click on "Yes" in the pop-up dialog box.
    Copy and paste the VBScript commands into it and save the file.

    You may add the following command atop the file.

    On Error Resume Next

    You won't see an error message even if "C:\Program Files (x86)\BlahBlahBlah\DeleteFolder" does not exist.
    thank you again

    - - - Updated - - -

    Silencious said:
    thank you again
    On error resume next....when you say atop the file do youme. wherewould I put this line?
      My Computer


  7. Posts : 7,607
    Windows 10 Home 20H2
       #7

    Copy it onto the first line of the file.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:41.
Find Us




Windows 10 Forums