How do I force delete an file on windows 10

I tried to delete a file I don't want, and it takes forever to delete. And when ever I tried to cancel it, it takes a long time canceling it too.

Proof:

https://gyazo.com/891e047e519a9f1c6fda5f37fe919b45

 

Question Info


Last updated August 19, 2019 Views 84,582 Applies to:
I use Powershell.
Give it a try and see if it works for you.
Go to search and type Powershell and then right click it and select run as administrator.
Command i use to remove a file say from my documents folder is this..

Remove-Item –path c:\users\sarah\documents\myfile.txt - force

Let me know if that helps.

36 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I try doing that a positional parameter cannot be found that accepts argument -

14 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Try it without the -force
Also make sure you are in powershell and NOT command prompt, big difference.

12 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

You can try deleting from the command line.

Open Start, type: CMD
Right click CMD
Click Run as administrator

Type CD followed by the drive letter

example: cd x:\
Hit Enter

X represents the name of the drive letter

Once you have navigated to where the folder is on the drive, type:

At the command prompt type del (delete) followed by the file name. Example: del win10uichanges.pptx
Best regards,
Andre Da Costa
Independent Advisor for Directly

11 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Does it seem like the the delete is happening or is the delete hanging because the file is in use by something else? Usually you get a message saying the file is locked pretty quickly.

The screen cap implies that you tried to delete the Downloads folder more than once, at the same time.

Instead of deleting the whole folder all at once. Try deleting smaller groups of files in the folder. See how that goes

If it takes a long time do the delete, and a long time to cancel, it sounds like it is a large file. Potentially one that has a lot of fragments.
To run better, run.
To paint better, paint.
To write better, write.
To build better, build.
— Sahil Lavingia

.
¯\_(ツ)_/¯

4 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

For whatever reason, Windows prevent some files from being deleted, moved or renamed. This locking up of files is incredibly frustrating, especially when you know the file is not, in fact, being used. Here is a great way to get around that issue. 

TO DO: Press Windows logo key + X, and hit C to open the command prompt. 

In the command window, type the "cd folder path" command and press Enter. Then type del/f filename to force delete the file that is in use. 

Note: In the above command, "foldpath" is the location of file. "filename" is the name of the file or files, it must be replaced by the name of the file along with its extension that you want to delete. For example: del /f test.txt.

WARNING!! – A file deleted using the DEL command does not move it to the Recycle Bin but deletes it permanently. Use the DEL command with caution. If you want to permanent delete files without data recovery,  FileZero is a good helper, it is easy-to-use and securely wipe data.

11 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

UPDATE: After a random update, the file that I tried to remove is now easily removable. Thank you to everyone who tried to help me

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I got the following error when trying your method:

PS C:\WINDOWS\system32> Remove-Item –path D:\Newfolder -force

Confirm
The item at D:\Newfolder has children and the Recurse parameter was not specified. If you continue, all children will
be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): a
Remove-Item : Could not find a part of the path 'D:\Newfolder\Locatie gericht ontwerpen\Groepsopdracht\Renders'.
At line:1 char:1
+ Remove-Item –path D:\Newfolder -force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (D:\Newfolder:String) [Remove-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : RemoveItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

Although the files are still visible in windows explorer. I hope you can help me further with this.

6 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.