Windows 10: How do I make a program that scans through the c drive and deletes all folders with nothing...

Discus and support How do I make a program that scans through the c drive and deletes all folders with nothing... in Windows 10 Ask Insider to solve the problem; I am going through my grandfather’s old computer and on his C drive, he has 23,000 files at 16,000 folders. I would guess about 70% of those folders... Discussion in 'Windows 10 Ask Insider' started by /u/outback3725, Mar 15, 2020.

  1. How do I make a program that scans through the c drive and deletes all folders with nothing...


    I am going through my grandfather’s old computer and on his C drive, he has 23,000 files at 16,000 folders. I would guess about 70% of those folders contain no files but have hundreds of sub folders.

    The worst is when there is a parent folder that contains 8 files hidden somewhere in a mess put 300 folders.

    Is there a way that I could make a batch file or something of that sort that would scan through documents and delete all folders with nothing in them or folders with no files in them. I want to clear out the C drive so that the only folders that are left are the ones that contain files.

    Anything you can offer is appreciated.

    submitted by /u/outback3725
    [link] [comments]

    :)
     
    /u/outback3725, Mar 15, 2020
    #1
  2. Anusha Win User

    C windows installer folder - Delete?

    He can do symbolic link redirection and move the files in it to a different location. *Wink How do I make a program that scans through the c drive and deletes all folders with nothing... ;)
    Better try it out in a virtual of first. Just a suggestion.

    Like:
    First move everything in c:\windows\installer to d:\installercache
    Then delete c:\windows\installer folder
    Then type this in command mode as admin
    mklink /d c:\windows\installer d:\installercache

    Removing those installer files is a bad idea. it might prevent you from updating or uninstalling apps.
     
    Anusha, Mar 15, 2020
    #2
  3. Trouble deleting a folder

    Thanks for the suggestion but it says "delete folder failed for E:\....." for each folder I try.

    *Confused How do I make a program that scans through the c drive and deletes all folders with nothing... :confused:

    Will I be forever stuck with these unnecessary folders? *Oh Well How do I make a program that scans through the c drive and deletes all folders with nothing... :eek:hwell:
     
    oli_ramsay, Mar 15, 2020
    #3
  4. topgundcp Win User

    How do I make a program that scans through the c drive and deletes all folders with nothing...

    Unable to delete a folder - Invalid folder name


    Suggestion:
    1. Run chkdsk x: /r to make sure that there's no HD corruption.
      x: is the drive containing the folder you want to delete.
    2. Try to delete the folder again. If still does not work, go to step 3.
    3. Download: Download - Linux Mint and create a bootable USB using: Rufus - Create bootable USB
    4. Boot up with Linux Mint and try to delete the folder again.
      NOTE: Unlike WinPE. Linux does not have any Windows permission imposed to it so it is easier to delete.
     
    topgundcp, Mar 15, 2020
    #4
Thema:

How do I make a program that scans through the c drive and deletes all folders with nothing...

Loading...
  1. How do I make a program that scans through the c drive and deletes all folders with nothing... - Similar Threads - program scans through

  2. How do I move all program and system files from c drive to d drive?

    in Windows 10 Gaming
    How do I move all program and system files from c drive to d drive?: I created a smaller partition ~120 GB that I thought would be big enough for apps and programs and a larger partition ~930 GB that I planned to put all my data onto thinking data would take up more space. After three years of use, the main "user" file which is in the smaller...
  3. How do I move all program and system files from c drive to d drive?

    in Windows 10 Software and Apps
    How do I move all program and system files from c drive to d drive?: I created a smaller partition ~120 GB that I thought would be big enough for apps and programs and a larger partition ~930 GB that I planned to put all my data onto thinking data would take up more space. After three years of use, the main "user" file which is in the smaller...
  4. How do I make all personal folders default to C: drive?

    in Windows 10 Gaming
    How do I make all personal folders default to C: drive?: New Acer Aspire TC-1760Windows 11 ProVersion 21H2build 22000.2538I want all my files to be saved on the C: drive by default. In File Explorer, under 'Quick Access', I edited the User registry to default Desktop, Documents and Pictures to C:\User\myname\foldername. In File...
  5. How do I make all personal folders default to C: drive?

    in Windows 10 Software and Apps
    How do I make all personal folders default to C: drive?: New Acer Aspire TC-1760Windows 11 ProVersion 21H2build 22000.2538I want all my files to be saved on the C: drive by default. In File Explorer, under 'Quick Access', I edited the User registry to default Desktop, Documents and Pictures to C:\User\myname\foldername. In File...
  6. How do I delete C:\hpswsetup folder?

    in Windows 10 Network and Sharing
    How do I delete C:\hpswsetup folder?: I have a C:\hpswsetup folder from when I updated drivers. The folder just contains installers but windows won't let me delete said folder and it's not automatically deleting the folder how do I fix this?...
  7. How do I delete C:\hpswsetup folder?

    in Windows 10 Gaming
    How do I delete C:\hpswsetup folder?: I have a C:\hpswsetup folder from when I updated drivers. The folder just contains installers but windows won't let me delete said folder and it's not automatically deleting the folder how do I fix this?...
  8. How do I delete C:\hpswsetup folder?

    in Windows 10 Software and Apps
    How do I delete C:\hpswsetup folder?: I have a C:\hpswsetup folder from when I updated drivers. The folder just contains installers but windows won't let me delete said folder and it's not automatically deleting the folder how do I fix this?...
  9. I deleted a program through the program files folder and then I tried reinstalling it but...

    in Windows 10 Ask Insider
    I deleted a program through the program files folder and then I tried reinstalling it but...: The app was the EA play app I deleted every possible thing related to this app but nothing works submitted by /u/oferpoferlofer [link] [comments] https://www.reddit.com/r/Windows10/comments/mit6t6/i_deleted_a_program_through_the_program_files/
  10. How do you make program folders?

    in Windows 10 Software and Apps
    How do you make program folders?: In previous versions of windows, you could make program folders and nest the programs you wanted inside of them; I have no clue as to how to do that in windows 10; I had them organzied that way in Win 7, and after upgrading to 10, some of them do show up on the start menu,...