How To Delete Files And Folders With A Batch File

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • list of my created websites: jebbidanyt.000...
    my main website: jebbidan.edito...
    the code:
    @echo off
    cd /d "enter your directory here"
    cls
    title delete files and fodler
    echo deleting...
    echo.
    echo please wait!
    for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
    del . /q
    rem the "del" command is useful for deleting files
    rem the "*.*" argument on the del command is useful for deleting every types of file
    rem this command: for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
    rem is useful for deleting every files in a directory

Комментарии • 44

  • @RLiz08
    @RLiz08 2 года назад +1

    Great video. Helped me a lot. My nephew did say you sounded like Arnim Zola from the MCU lol

  • @AndrewSimonow
    @AndrewSimonow 2 года назад

    When I insert my delete.bat "G:\delete.bat" into Task Scheduler, "Start A Program" ... when runs, it tries to delete ALL files on my computer???? I have the bat file in my G:\ drive where the directories are I want to delete. Running the bat file from a command line works great! ???? help

    • @Jebbidan
      @Jebbidan  2 года назад

      Well I don't know about that one. Sorry

  • @karloburat
    @karloburat 9 месяцев назад

    Hi, how to delete file from all user profiles using batch files? Thank you

    • @Jebbidan
      @Jebbidan  9 месяцев назад

      I will look into that. thanks for the suggestion

  • @khalidalanazi3677
    @khalidalanazi3677 2 года назад

    how to make the batch connect to server and delete some files on it. please your advice.

    • @Jebbidan
      @Jebbidan  2 года назад

      You cannot do that stuff with a batch file. Only programming language that has the ability to connect to a remote server can

  • @msyaiful7224
    @msyaiful7224 2 года назад

    Hi. What if, the date of folder is refering to the name of folder instead of the modified date? Can we delete it based on the folder name?

    • @Jebbidan
      @Jebbidan  2 года назад

      well that is pretty easy, just add this code:
      rd /q /s "insert full directory to the folder here"

  • @md.raihanshovo6662
    @md.raihanshovo6662 2 года назад

    Can you delete files if the files are in the same folder where the bat file is?

    • @Jebbidan
      @Jebbidan  2 года назад

      yes, you got to specify what's the file type you are going to delete.
      for example, I want to create a batch file that deletes all text files in the same folder so I'm going to use the .txt file extension:
      del /q *.txt

  • @naseemjumma6229
    @naseemjumma6229 2 года назад

    How to overwrite the drive and delete multiple times to erase data permanently?

    • @Jebbidan
      @Jebbidan  2 года назад

      you mean you want to format the drive?

  • @hahahhaiahfa5412
    @hahahhaiahfa5412 Год назад

    Can batch file uninstall through cmd? if yes can u say

    • @Jebbidan
      @Jebbidan  Год назад

      Well technically yes, you can uninstall using cmd. It's just that it is tedious to copy and paste every single filenames to a batch file

  • @Burgie3
    @Burgie3 7 месяцев назад

    thank you i deltete my hole PC

  • @mosesmasaku8779
    @mosesmasaku8779 Год назад

    Can you assist me with a batch script to uninstall office 2019

    • @Jebbidan
      @Jebbidan  Год назад

      You want me to create a batch script that uninstall office 2019 for you? Well I can't do that right now but expect a new tutorial video from me on how to do just that

    • @mosesmasaku8779
      @mosesmasaku8779 Год назад

      @@Jebbidan A tutorail will help, when will the tutorial be available?

    • @Jebbidan
      @Jebbidan  Год назад

      @@mosesmasaku8779 by tomorrow so expect a video from me (note: you should subscribe to my channel first to get notified)

    • @mosesmasaku8779
      @mosesmasaku8779 Год назад

      @@Jebbidan Yes I did thanks

    • @Jebbidan
      @Jebbidan  Год назад

      uhh... i have bad news for you. right now, i can't upload the video i promised to you but by tomorow i will so be sure to wait for it

  • @skynupOfficial
    @skynupOfficial 2 года назад

    IT DELETED THE HALF OF MY DESKTOP

    • @Jebbidan
      @Jebbidan  2 года назад

      then don't run it on your main windows OS!!! use a virtual machine instead

    • @flauschfell932
      @flauschfell932 2 года назад

      @@Jebbidan But i dont have administrator :(

    • @flauschfell932
      @flauschfell932 2 года назад

      @@Jebbidan What now

    • @Jebbidan
      @Jebbidan  2 года назад

      @@flauschfell932 I don't know, get an admin pass?

    • @lqnnix9792
      @lqnnix9792 2 года назад

      me too

  • @jevinpioxavierj6109
    @jevinpioxavierj6109 3 года назад

    What is a batch file

    • @Jebbidan
      @Jebbidan  3 года назад

      a batch file is a script file that contains list of commands for the windows OS to execute

    • @jevinpioxavierj6109
      @jevinpioxavierj6109 3 года назад

      @@Jebbidan Thanks

    • @Jebbidan
      @Jebbidan  3 года назад

      @@jevinpioxavierj6109 your welcome

    • @rednexie
      @rednexie 2 года назад

      .bat

    • @pu4cac-redfox532
      @pu4cac-redfox532 2 года назад

      @@Jebbidan i need to delete a file every time it is created! May you help me

  • @lekdotoddyn8304
    @lekdotoddyn8304 2 года назад

    haha now win 32 on school pc go brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr (JK GUYS IS A JK DONT CANCEL ME ON TWITTER)