Skip to main content

Recursively deleting files in Windows

Due to a magical feature of OneNote software, one day I noticed lots of files with extension '.onetoc2' in one of the folder and each of it's subfolders. 

I found the below solution using wildcards with 'del' command and '/S' switch to remove them completely and recursively - 

1.  Open command prompt and go to home directory where you want to perform this operation
            cd MyFiles

2.  Run the below command –
del /S  *.onetoc2


PS: There's a huge difference between running del /S *.onetoc2 and del /S C:\*.onetoc2
The first command is executed from the current location, whereas the second is executed on the whole drive.


Comments

Popular posts from this blog

Solving PyCharm bug: "Python helpers are not copied yet..."

I have been using PyCharm Professional to run and debug Python code from my Windows machine to a remote Linux device. There are some other tools available for the same purpose (e.g. Python Tool for Visual Studio 2017). But in my opinion, PyCharm Professional stands out among its counterparts as it comes with a "All Batteries Included" setup. Once you configure remote Python interpreter in PyCharm, then it works out of the box. However, today after upgrading to PyCharm Professional 2018.2.1, I could not run my Python script on remote device. The execution always failed with below error - "Error running 'hello': Python helpers are not copied yet to the remote host. Please wait until remote interpreter initialization finishes." To solve this issue, I had to remove the ".pycharm_helpers " folder from the remove device and then restart PyCharm so that the folder is re-created and files are copied again. Here are the steps with comma...

Solving ‘Could not resolve host: github.com’ issue

Recently I ran into this issue while trying to clone one of my own repository from GitHub C:\GitHub\FS> git clone https://github.com/<username>/FS.git Cloning into 'FS'... fatal: unable to access 'https://github.com/<username>/FS.git/': Could not resolve host: github.com At first I thought that this could be due to some proxy setting. So I tried to unset it by executing below command - C:\GitHub\FS> git config --global --unset https.proxy But that didn’t fix the problem and I was still getting the same error. As it turned out later, the culprit was my VPN connection. Turning off the VPN fixed the issue. For the records, I was using ‘Surfshark’ on my Windows 10 laptop.

Threading tutorials from Microsoft

Do you know what’s lurking in the deepest, darkest parts of your thread pool? Take control of that monster and keep your applications responsive by becoming a threading expert with this free 5-part course. Advanced .NET Threading , Part 1: Thread fundamentals Advanced .NET Threading , Part 2: Compute-bound async operations Advanced .NET Threading , Part 3: I/O-bound async operations Advanced .NET Threading , Part 4: Thread synchronization primitives Advanced .NET Threading , Part 5: Thread synchronization locks