#Cmd c windows windows#
Add cmd /c "cd %1 & delete.bat" as the value.įast Delete option in Windows Explorer context menu.Double-click on default of the command key.Right-click on Fast Delete, and select New > Key.Right-click on Shell and select New > Key.Go to HKEY_CLASSES_ROOT\Directory\shell\.Tap on the Windows key, type regedit.exe, and tap in the Enter key to open the Windows Registry Editor.This can be executed in all major versions of Windows including Windows XP, Windows 7, and Windows 10. Adding batch file to Windows registryĭo the following to add the new batch file to delete folders quickly to the Windows Explorer context menu. bat file in C:\Windows so that the Windows registry can easily access it. While you may create your own variable, you may also move it to a folder that is already supported e.g.: C:\Windows. You need to add the batch file to a location that is a PATH-environment variable. If you press any other key, all folders and files will be deleted without any option to stop the process.
You can use CTRL-C or click on the x of the window to stop the process. This provides you with an option to stop the process important if you have selected the context menu item by accident. The batch file comes with a security prompt. You can do this by selecting Save as type as All Files.
#Cmd c windows code#
Create a new plain text document on Windows, and paste the following lines of code into OFF This saves even more time without depending on a third-party software.įor this, the first thing you need to do is create a batch file. You may add the command to the Explorer context menu so that you can run it from there directly.
However, if you do use it frequently, you may prefer to optimize the process. If you don't need to run the command often, you may be perfectly fine running the commands directly from the command prompt. Method #2: Creating a Batch File for Quick Deletion foldername - The absolute path or relative folder name, e.g./S - Run the operation on all folders of the selected path./Q - Quiet mode, won't prompt for confirmation to delete folders.This improves the process further, shaving off about one quarter of the processing time off of the console command. /S - runs the command on all files in any folder under the selected structure.You are not asked if it is ok to delete files (if you don't use this, you are asked for any file in the folder, which can be time-consuming and therefore counter-productive). /F - forces the deletion of read-only files.Here are descriptions of each of the commands used above. Run the command RMDIR / Q / S foldername to delete the folder and all of its subfolders.to navigate to the parent folder afterwards. * > NUL deletes all files in that folder structure, and omits the output which improves the process further. Navigate to the folder that you want to delete (with all its files and subfolders).Tap on the Windows-key, type cmd.exe and select the result to load the command prompt.Here’s the step-by-step process to delete large folders using CMD: