[SOLVED] There is about 30000 directories on my desktop

Mar 17, 2021
1
0
10
My friends launched a batch file on ,my windows computer with his USB key. He explained to me that this batch file loop and create a lot of folder on my desktop. After that I tried to remove them by using the windows terminal. I failed. I can't delete them manually, because i can't open the desktop folder and ther is no more file on my pc. I am lagging a lot when I open it. I tried to restart my computer a few times. It didn't work either. I put my bootable usb key in my pc and now I am on my linux debian os. I can see my windows folder from this OS but I can't interact with them. Is there a way to delete all the files without deleting all my stuff on it ?

<Mod Edit -- Dangerous script removed. Script was a loop that created 100's or 1000's of folders that are 1 or more digits of numbers.>


Thank you in advance
btw he is not my friend anymore, i'm almost a noob in computer and im french so sorry for my english.
 
Last edited by a moderator:
Solution
Boot your PC in safe mode, or with installation media. Open command prompt, navigate to C:\Users\<your user>\Desktop,. From there, execute "dir /p", and see what folders you have to remove, then "del <foldername> /p /s".

On another PC - open cmd.exe, execute "del /?", and learn the options to speedup the process.
most windowses these days using onedrive folder for desktop
and ure sure u want to manualy delete 30k folders with that command? unless u mean to delete desktop folder, that would work i guess
if u have onedrive enabled (signed with microsoft account) then u need to close onedrive first. u can find cloud icon in taskbar near time, right click it and close it.
once closed, click start menu and type desktop on it, from available searches pickup file folder to open it,
from here u can delete it, once gone, enable onedrive

if u have local account...then its same, just no onedrive action needed

if this for some odd reason wont work out... go to account settings and make new account, then delete old account
 
Been there did that. 7500+ folders at once, until Windows XP crashed :) Cluttered MFT is slow in cleaning, I agree here. Listen what people said and sign out from all cloud services where your desktop may be saved like OneDrive, Dropbox or Google Drive at first. You will deal with them later. Then clean all recently added folders (sort by date) with funny names on desktop . Preferably not from Windows Explorer, but Far Manager or Total Commander. Possible to delete also from batch file with forfiles command (maybe someone can provide a script here). Don't be afraid that first try will crash - repeat until all unwanted folders are removed.

FYI: Acquaintances and friends are two different animals.
 
Boot your PC in safe mode, or with installation media. Open command prompt, navigate to C:\Users\<your user>\Desktop,. From there, execute "dir /p", and see what folders you have to remove, then "del <foldername> /p /s".

On another PC - open cmd.exe, execute "del /?", and learn the options to speedup the process.
 
Boot your PC in safe mode, or with installation media. Open command prompt, navigate to C:\Users\<your user>\Desktop,. From there, execute "dir /p", and see what folders you have to remove, then "del <foldername> /p /s".

On another PC - open cmd.exe, execute "del /?", and learn the options to speedup the process.
most windowses these days using onedrive folder for desktop
and ure sure u want to manualy delete 30k folders with that command? unless u mean to delete desktop folder, that would work i guess
 
Solution