2

I only copied one folder node_modules from D:/some_folder/node_modules to C:/another_folder/node_modules and now cannot delete C:/another_folder/node_modules. It says I need administrative privileges.

I am the owner.

I am the administrator.

I've tried few command lines I found here like this one: https://superuser.com/a/1580457 and rmdir /s /q C:\ProgramData\FolderToDelete this one, but nothing is working. I looked in process explorer and I see nothing about the folder.

What else can I try?

cikatomo
  • 133

1 Answers1

2

Attempt to delete the folder in question from an Elevated Command Prompt from a Safe boot.

For the non-tech-savvy, you may want to write down or print these instructions out before proceeding.

  1. Press ⊞ + R, type "msconfig" without the quotes, and press Enter
  2. Switch to the "Boot" tab, check the "Safe boot" checkbox, and leave it set to Minimal.
  3. Hit "Apply", hit "OK", and restart the computer.
  4. The system will boot into Safe Mode, loading only necessary processes and services.
  5. Press ⊞ + R, type "cmd" without the quotes, Hold CTRL + SHIFT, and while holding CTRL + SHIFT, press Enter. This will open an elevated command prompt with administrator privileges.

Alternatively, for step 5 you can Right-click the Start Button on your task bar, and >Select "Windows Powershell (Admin)", although powershell has differences from cmd.

  1. Attempt to run the command rmdir /s /q C:\path\to\FolderToDelete where the last part is the path to your actual desired directory to remove. Be warned that this will delete the directory, as well as any directories or files inside of it!

Once you have resolved the problem, follow steps 1, 2, and 3 again, with the exception of UNCHECKING "Safe boot" instead of checking it. This will get your system back into a normally booting situation.

Hashgrammer
  • 409
  • 2
  • 7