Deleting files through command prompt




















In this case, you'll want to avoid the "Administrator" or "Admin" version of Command Prompt unless you're deleting a file in the "System32" folder. Right-click the Start button in the bottom-left corner of the screen, then click Command Prompt in the pop-up window. Type "Command Prompt" into the Start menu search bar for Windows 8, hover your mouse in the top-right corner of the screen and click the magnifying glass , then click the "Command Prompt" icon when it appears.

Open the "Run" app from the Start menu, type in "cmd", and click OK. Doing so will change the location or "directory" in Command Prompt to your desktop. There are other ways you can change the Command Prompt directory if need be. Opening Command Prompt in "Administrator" mode will change the directory to the "System32" file.

For this reason, do not open Command Prompt in "Administrator" unless your file is in the "System32" folder. Type in del [filename. Replace "filename. For example, a picture file named "icecream" would become icecream. For files with spaces in their names, place quotation marks around the entire file name: "I like turtles. To delete all files on your desktop that share the same extension e. You will see a new, blank line appear in Command Prompt.

Your file is now gone. Since the "del" command removes files directly from your hard drive, you won't need to delete the file again from the Recycling Bin. Only files have extensions. Directories are handled differently by the filesystem, and thus do not need extensions. Not Helpful 18 Helpful Some type of virus installed to my PC and won't let me use Command Prompt. What should I do?

Try running an antivirus program to eliminate the virus. If that doesn't work, you'll probably need to take your computer in to a tech department somewhere e. Not Helpful 4 Helpful 9. When I typed "cd desktop" in Command Prompt's Administrative mode, it shows "the system cannot find the path specified". You should open Command Prompt in its non-Admin format--e. Since Command Prompt Admin opens inside of the "System32" folder, you won't be able to open the desktop from there because the "Desktop" folder is under your name in the "Users" folder, not in the "System 32" folder.

Improve Article. Save Article. Like Article. Previous Solidity - Break and Continue Statements. Next Pandas - Convert the first and last character of each word to upper case in a series. Recommended Articles. Article Contributed By :. Be very careful where and how you use this command.

Also, bonus tip — Command Prompt has basic autocompletion. So you could just type in del test , press the tab key, and Command Prompt will change it to del "Test File. Sometimes files are marked as read only, and you'll see the following error when you try to use the del command:.

Both commands work the same way, but let's stick with rmdir since it's a bit more expressive. Also, I'll use the terms directory and folder interchangeably for the rest of the tutorial. Note: Any directories deleted with the rmdir command cannot be recovered. In this case I want to remove a directory named Subfolder, so I'll use the command rmdir Subfolder :. You could cd into the Subfolder directory and remove the file, then come back with cd..

And just imagine if there were a bunch of other nested files and directories! Unfortunately this does not delete folders! It only empties all of them. I am afraid there is no way in windows to empty a folder and delete not just files but also subfolders in there AFAIK.

The only way I am aware of is to delete the whole folder and then recreate it again Home Windows General Windows How-tos. Delete temp files with single command. General Windows Windows 7. Verify your account to enable IT peers to see that you are a professional. Last Updated: Dec 15, 1 Minute Read. Reply Facebook Twitter Reddit LinkedIn.



0コメント

  • 1000 / 1000