C windows system32 cmd exe q c rmdir s q что это

This document contains special characters. When creating a link that will take you to this document, you must enter the following:

[[cmd /c rd /s /qc:\\]] or [[cmd /c rd /s /qc:\]]

For more details, see Namuwiki Grammar Help .

If you run this command by mistake, immediately close the command prompt or forcefully shut down the computer and then turn the computer back on.[1] You will need to format Windows and reinstall Windows using a clean install.[2]

1. outline2. Translate3. If you type it into someone else’s computer4. etc

1. outline

Microsoft Windows This command deletes all subfolders and files of the C drive in the operating system . It was used a lot for fishing by non-conceptual elementary school students who like to play with Jammin , and when looking at the CLI , it became an object of fear for computer users who get sick . It does not work well for those born in the 80s who have often seen CLI since their elementary school days, or those who are interested in computers. Of course, it doesn’t work even if you assign a different letter to the drive letter where Windows is installed. Up to Windows Vista, it was fine when installed on the D drive, but Windows 7 (2008 R2) or later and Windows XP Media Center Edition are installed on the E drive, but when booting, the drive where Windows is installed is C: (you can change it with diskpart afterwards) ). If you want it to work even if you assign it to a different letter, replace C: with %SystemDrive%.

Windows mounts the partition it is installed in by default setting it to C as the drive letter , and not all files required to run the OS are used 24 hours a day. Since there are quite a few files that are only required at boot time or are read only when using certain functions, deleting only files that can be deleted from the C drive, or even touching a single byte of an important file without deleting the file, can block booting . Therefore, executing this command was the same as summarily disposing of the computer , so it was circulated like a ghost story on the Internet . However, since the BIOS / UEFI stored on the motherboard remains intact, it can be used again by reinstalling the OS.

This command line in notepad or portal site There is no problem in typing in other text forms, such as search windows and chat windows, but start — run — press the enter key after entering the command, the command prompt will run and all user data, important programs, and kernels stored in the C drive will be displayed . Delete. Now, when the execution is finished and rebooted, you can see the computer that can’t come back to life. This applies to everything from Windows NT 4.0 to Windows 10 (2016, 2019). 2000 only keeps black screen, NT 4.0 shows <A kernel file is missing. Press ctrl+alt+del to restart.> 2000 was being developed for NT 5.0, so the Windows NT kernel is no exception. And this command also applies to Windows NT 3.1 . Windows NT 3.1 does not have the /q option switch, so you can do rd /s C:. Windows XP says it is an unrecognized operating system and upon reboot it just shows a black screen.

This is a command that should never be executed if there are important files on the disk or if there is an operating system that needs to be written continuously . Still, if you really want to try it once out of curiosity, you should try installing Windows on a virtual machine or run it on a computer that you plan to dispose of because you really have no use for it anymore. On YouTube , there are many videos of actual practice in Japan .[3] It’s also possible to do it on a small scale, even if it’s not on the C drive, by creating a small experimental folder or using a USB drive that’s rarely used. This is safe as it is limited to the experimental folder and not the entire C drive. The command is RD (Example folder name and path) /S /Q (Example: RD C:Example /S /Q).

Also, type the above command into Notepad , save it as a batch file (*.bat), convert it to *.exe executable file, change the icon to a more attractive one, disguise it as a program that is easily fooled by various keygens or elementary school students, or copy it into the program file folder. More and more cases are being spread by disguising it as if it were another program. Because it is one of the normal Windows commands, it is not detected by anti-virus software, making it even more dangerous. In fact, in the case of game executable files, there are no DLL files or[4] If there is only an executable file without a resource file, you should be suspicious. But these days, vaccines detect. It was confirmed that Kaspersky was detecting it.

However, there are more malicious ones such as powershell -WindowStyle Hidden -command «rmdir -Path \localhostC$* -Force -Recurse». This command changes WindowStyle to Hidden using Powershell and executes the command rmdir -Path \localhostC$* -Force -Recurse . First, rmdir is the same as rd in cmd and is not a widely known command like rd, but can be used as a trick, and -Path means path and deletes \localhostC$*. Here, \localhostC$ is the C drive connected to this computer through a network, so it is no different from just the C drive. Of course, this too is a trick. The subsequent -Force -Recurse forces deletion in order, deleting all folders and files within the folder.

2. Translate

«cmd /c» means to run the command prompt (cmd.exe) and receive and process the string that follows. Even if you run the command prompt and then enter rd, the same result is obtained. As you know, c: means the root of the C drive, and rd is an abbreviation for Remove Directory, which is a command to delete a folder. That is, it is different from the del command, which deletes files. Basically, deleting a folder is impossible if other files or folders exist in the folder. However, if the /s command is attached, all subfolders and files within the folder are deleted . Finally, the /q command is a Quiet command, which does not display messages on the screen. Therefore, it does not ask «Do you really want to delete it? (Y/N)». If you do not put the /q option, you will go through the verification process individually, but your hands will suffer because there are a lot of files and folders in the C drive.

In summary, it is as follows.

command

meaning

cmd

run cmd.exe

/c[5]

Take the following string and execute it

rd[6]

delete the folder

/s

All subfolders and files

/q[7]

without warning

c:[* It is a backslash character (U+005C). Note that in some Korean or Japanese fonts, backslash characters appear as the currency symbols ¥ and .]

from C drive root

cmd /c rd /s /q c:»’ || Delete all subfolders and files on the C drive in a cmd environment without warning»’ .

In other words, it can be interpreted as delete all subfolders and files in the C drive without warning . Here, if you specify the c: part as a different path, the same operation will be performed in that path. For example, d: deletes files in drive D.

If you want to try it yourself without any damage, you should use a virtual machine such as VMware . There are some that are provided free of charge to individual users (VMware Player, etc.), so if you can install Windows, you can try them without burden. If you search on YouTube, you can find many videos for each version of Windows about what happens when you run this command. Even if you run that command for just one second on the actual host, many files will be deleted, so if you don’t want to see all the files in your storage media disappear by mistake, you should never enter it directly on the host.

In summary, you can type cmd /c rd c: /s /q in the run window by pressing Windows key + R, and you can only type rd c: /s /q in the command prompt.

In Windows 10 , the Start menu even includes search and run functions, so you can press the Windows key to open the Start menu and type cmd /c rd /s /q C:.

3. If you type it into someone else’s computer

If you enter this command on someone else’s PC or a public computer installed in an PC room , library , school , etc., or a work computer in a company, business , shop , government office , or public institution without permission, the crime of damage is established and you will be subject to criminal punishment. It may not matter if it is automatically restored when rebooting , but when others see it, it will inevitably be seen as sabotage . In the process of executing this command, there is no objection if even the files necessary to run the auto-recovery program are deleted. In addition, if video security is established nearby, the video record will remain as conclusive evidence.

4. etc

Before the truth was known to some extent, there were malicious people who spread false rumors such as «If you use this command, your computer will speed up» or » Computer viruses will be eradicated» on Naver Knowledge iN or blogs . Neither is wrong. As the resources to be processed rapidly decrease, the speed will increase, and if you delete all the files on the drive, the virus will of course be eradicated, but the most important operating system will be together , so your mentality will be very futile . There was a time when there was a post that complained of damage and asked how to recover from being caught by this. In fact, it’s not even 100% sure eradication. If the virus overwrites the CMD or is on a drive other than C, the virus may remain after formatting. If you format to delete viruses, do not use the command prompt or Windows recovery function, but run Windows in safe mode. Just buy a new disk and install it on it.

It has less impact than rm -rf / , but it is difficult to remember because it is long, and there are differences in how to connect auxiliary storage devices. Unix-type OS treats all auxiliary storage devices as directories (folders) and uses a mount function that attaches them under the top directory, but Windows uses a drive letter that assigns alphabet letters such as C and D to auxiliary storage devices , and is a completely separate device conceptually. separate with Therefore, rm -rf / wipes out all auxiliary storage devices connected to the computer, but cmd /c rd /s /qc: does not delete auxiliary storage devices other than the C drive. To delete a single drive on Unix-like systems, you can enter /volume/drivename.

This command does not work in DOS or 9x series of Windows. This is because the rd command does not have the /s option. Instead, you can use deltree (a command similar to RD /S) to write deltree /y C:. Since this method uses a built-in utility of MS-DOS, the deltree.exe file must be present. Also, since this command was added in MS-DOS 6.0, there is no method in previous versions.

If you want to delete all the files in the corresponding partition, whether it is the C partition or the D partition, it will not work unless you run it except for DOS or 9x series windows. Windows up to (2003/R2) must be executed after logging on with an administrator account. This is because, after logging on with an administrator account, just running the application will run it with administrator privileges.

In some programs, ‘echo y | You may run ‘del *.* /s /q /f’. All files are also initialized.

Running without administrator privileges only deletes a portion of programs and windows.

There is also a del /s /qc: as a variation. On Unix-like OS there is rm -rf / .

[1] This is not to say that it won’t turn on at all, but rather to Windows loading failure (blue screen, etc.). Unlike UNIX-type rm -rf /, which structurally deletes data on other writable drives that are mounted under the root, this command deletes only the C drive. Therefore, if a partition created separately, such as drive D, exists , the partition is alive unless a command other than the command written in the title of the document is issued (e.g. cmd /c rd /s /q d: ) .[2] In fact, even if it turns on, it is recommended to reinstall Windows, or at least to check the system integrity (DISM, SFC command, etc., which can be easily used for Windows error recovery). There are many system files that are necessary for the system but have been deleted due to reasons that protection was not applied or were not in use (Lock) at the time, which causes unstable operation of the operating system.[3] youtube video[4] However, there are cases where the program uses Static Linking (a linking method that includes all libraries in one executable file, i.e. does not require a DLL for execution), so do not immediately suspect that there is no DLL file and start by looking for the resource file.[5] To be precise, after executing the following commands, cmd.exe is terminated. If you want the command prompt window to remain, you can use /k.[6] Abbreviation for remove directory . erasing all data.[7] Abbreviation for quietly , which means to run quietly without warning.

В командной строке Windows для удаления папок (каталогов) используется команда rmdir. С помощью данной команды можно удалить одну или несколько папок в указанном каталоге в месте с ее содержимым (включая все файлы).

Синтаксис


rmdir [<drive>:] <path>  [[/s] [/q]]

Параметры


Параметр Описание
<drive>: Указывает расположение и имя каталога, который требуется удалить.
<path> Путь является обязательным. Если включить обратную косую черту () в начале указанного пути, то путь начинается с корневого каталога (независимо от текущего каталога).
/s Удаляет дерево каталогов (указанный каталог и все его подкаталоги, включая все файлы).
/q Задает тихий режим. Не запрашивает подтверждение при удалении дерева каталогов. Параметр /q работает только в том случае, если также указан параметр /s .
/? Отображение справки в командной строке.

При запуске в тихом режиме все дерево каталогов удаляется без подтверждения. Перед использованием параметра командной строки /q убедитесь, что важные файлы перемещаются или создаются резервные копии.

Команда rmdir не сможет удалить каталог содержащий скрытые или системные файлы. При попытке появится следующее сообщение:

The directory is not empty (Каталог не пустой).

Используйте команду dir /a , чтобы получить список всех файлов (включая скрытые и системные). Затем используйте команду attrib с параметром -h , чтобы удалить скрытые атрибуты файла, -s , чтобы удалить атрибуты системного файла, или -h -s , чтобы удалить как скрытые, так и системные атрибуты файлов. После удаления скрытых атрибутов и файлов можно удалить файлы.

Вы не можете использовать команду dir /a для удаления текущего каталога. При попытке удалить текущий каталог появляется следующее сообщение об ошибке:

The process can’t access the file because it is being used by another process (Процесс не может получить доступ к файлу, поскольку он используется другим процессом).

Если появляется это сообщение об ошибке, необходимо выполнить переход в другой каталог (не в подкаталог текущего каталога), а затем повторить попытку.

Как удалить каталог в командной строке в Windows


Чтобы удалить каталог с именем MyDrectory в текущем каталоге, введите:

Как удалить каталог в командной строке в Windows

Как удалить каталог в командной строке в Windows

Также вы можете указать полный путь к удаляемой папке. Например, для того чтобы удалить папку в корне системного диска с:\ нужно выполнить:

rmdir c:\MyDirectory

Как удалить каталог в командной строке в Windows

Как удалить каталог в командной строке в Windows

Как удалить несколько каталогов включая их содержимое в Windows


Если нужно удалить сразу несколько каталогов включая их содержимое то есть все файлы которые находятся в этих каталогах. В этом примере удаляются каталоги и файлы в каталоге MyDirectory:

rmdir /s c:\MyDirectory

Как удалить несколько каталогов включая их содержимое в командной строке

Как удалить несколько каталогов включая их содержимое в командной строке

Как удалить каталог (папку) с ее содержимым рекурсивно без запроса для подтверждения в Windows


В этом примере удаляются каталог(папка) и все файлы находящиеся в каталоге MyDirectory без запроса подтверждения:

rmdir /s /q c:\MyDirectory

Как удалить каталог) с ее содержимым рекурсивно без запроса для подтверждения

Как удалить каталог) с ее содержимым рекурсивно без запроса для подтверждения

После того, как вы выполните эти шаги, каталог и ее содержимое будут удалены.

Параметр /s удаляет каталог и егосодержимое в приведенной выше команде, но запрашивает у пользователя подтверждение. Параметр /q игнорирует приглашение и рекурсивно удаляет каталог.

Delete FolderКоманда RMDIR используется для удаления каталогов в операционной системе Windows через командную строку. У команды RMDIR также есть синоним RD.

Синтаксис команды выглядит следующим образом:

RMDIR [/S] [/Q] [диск:]путь

или

RD [/S] [/Q] [диск:]путь

Команда имеет следующие параметры:

/S — удаление дерева каталогов, т.е. будет удалён не только указанный каталог, но и все содержащиеся в нём файлы и подкаталоги;

/Q — отключение запроса на подтверждение действия при удалении дерева каталогов с помощью ключа /S.

Примеры использования команды rmdir:

Удаление папки C:\Primer:

rmdir C:\Primer

Обратите внимание, что в этом примере не задан параметр /S. Это значит, что удаляемая папка должна быть пустой.

Удаление папки C:\Primer и всех её подпапок:

rmdir /s C:\Primer

Удаление папки C:\Primer и всех её подпапок без запроса на подтверждение:

rd /s /q C:\Primer

Команда rmdir (rd) позволяет одновременно указать несколько каталогов. Но вот шаблоны имён файлов и папок не поддерживаются. Например, если указать путь C:\Primer\*.*, то попытка выполнения команды завершится сообщением об ошибке.

Удаление двух каталогов:

rmdir C:\Primer C:\Primer2

Если нужно очистить каталог, но не удалить его, можно сначала сделать его текущим, после чего запустить команду rmdir (rd):

cd "C:\Primer Folder"
rd /s /q "C:\Primer Folder"

Если имя каталога содержит пробел, его нужно заключить в кавычки.

What is the windows equivalent of rm -r [directory-name]?

asked Aug 23, 2010 at 19:29

Eric Wilson's user avatar

Eric WilsonEric Wilson

7,89812 gold badges41 silver badges50 bronze badges

deltree if I remember my DOS.


It seems it’s been updated… this is what you want:

RMDIR /S

This removes the directory C:\test, with prompts :

rmdir c:\test /s

This does the same, without prompts :

rmdir c:\test /s /q

Regarding the sudo part of your question, if you need more priviliges, you can first open a new shell as another user account using the runas command, like this:

runas /user:Administrator cmd
rmdir c:\test /s /q

answered Aug 23, 2010 at 19:30

Colin Pickard's user avatar

Colin PickardColin Pickard

8,5993 gold badges31 silver badges38 bronze badges

2

If you want to delete a long and complicated folder structure from the command prompt that RmDir won’t touch and not even explorer can display, I’ve found robocopy can be very efficient at removing the structure.
In the example below we have a massive structure inside the folder administrator, the structure is so deep that nothing can remove it.
We create a new empty folder called (strangely enough!) «new folder».
We then use the robocopy command, telling it the source folder is «new folder» and the destination folder is «D:\Administrator» with the /MIR parameter which means it will purge anything not in the source folder.

robocopy "D:\new folder" D:\Administrator /MIR

In this case the folder paths were so long they would not even fit in the command prompt window Screen Buffer, but Robocopy will traverse the structure and remove any «extra» files and folders (ie anything not in the new empty folder, which is everything).

answered Aug 9, 2012 at 23:13

Sean's user avatar

SeanSean

8016 silver badges3 bronze badges

1

You can do the following in PowerShell, if you’re on Windows Vista+ :

rm C:\path\to\delete -r -f[orce]

answered Aug 22, 2015 at 16:51

Devesh Khandelwal's user avatar

2

For me, what works is

del /s dir

You can add /q to disable confirmation. I’ve never managed to get rmdir working (on XP)

answered May 17, 2014 at 7:42

Vincent Fourmond's user avatar

2

If you have a really really long path, (like I did because of java program error), even robocopy cant do it. It descended for about 30sec into my path and then hung.

My solution: if you can move the whole problem path from one folder to another then you can cut away recursivly and repeatedly some directory stairs from the top.

This Batch plays pingpong between the two directories leer and leer2 and cuts away 8 ‘libraries’
each time. If your path contains files, you have to add further commands to erase them.

recurdel.cmd
:loop
move c:\leer\libraries\libraries\libraries\libraries\libraries\libraries\libraries\libraries c:\leer2
rd /S /Q c:\leer\libraries
move c:\leer2\libraries\libraries\libraries\libraries\libraries\libraries\libraries\libraries c:\leer
rd /S /Q c:\leer2\libraries
GOTO loop

Eric Wilson's user avatar

Eric Wilson

7,89812 gold badges41 silver badges50 bronze badges

answered Mar 5, 2014 at 8:37

Paulmann's user avatar

PaulmannPaulmann

511 silver badge1 bronze badge

0

From CMD Just run RD /s C:\path\to\delete

Hit Y to the prompt

/s ensures all the sub directories are deleted as well.

Reference:

  • Run help RD from the command line

Wasif's user avatar

Wasif

8,0642 gold badges19 silver badges32 bronze badges

answered Jan 22, 2016 at 6:44

Rachit Ranjan's user avatar

0

In powershell:

Remove-Item "Path" -Force -Recurse

In short (nearly rm -rf):

rm  "PATH" -r -fo

answered Sep 25, 2020 at 2:10

Wasif's user avatar

WasifWasif

8,0642 gold badges19 silver badges32 bronze badges

This will delete «my folder» without prompt:

rd /s /q "C:\Users\gourav.g\AppData\Roaming\my folder"

answered Jul 4, 2018 at 7:09

GorvGoyl's user avatar

GorvGoylGorvGoyl

2371 silver badge13 bronze badges

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

The Windows Command Processor cmd.exe has two internal commands for deletion of files and folders:

  1. The command DEL is for the deletion of files with usage help output on running in a Windows command prompt window either help del or del /?.
  2. The command RMDIR or with shorter name RD is for removal of directories with usage help output on running in a Windows command prompt window either help rmdir or rmdir /? or help rd or rd /?.

Deletion of all *.svn files in an entire folder tree

There can be used in a Windows command prompt window or a Windows batch file the following command to delete really all files of which long or short 8.3 file name is matched by the wildcard pattern *.svn in the directory %USERPROFILE%\Projects or any of its subdirectories:

del /A /F /Q /S "%USERPROFILE%\Projects\*.svn" >nul 2>&1

The usage of option /A to match all files independent on the file attributes replaces the implicit default /A-H to ignore hidden files. So even files with hidden attribute are deleted by this command because of using the option /A. Files matched by wildcard pattern *.svn with hidden attribute set are ignored on not using the option /A.

The option /F forces a deletion of files with file extension .svn which have the read-only attribute set. There would be output the error message Access is denied. if a *.svn file has the read-only attribute set and the option /F is not used on running the command DEL.

The quiet option /Q prevents the user confirmation prompt Are you sure (Y/N)?.

The option /S results in searching not only in the specified directory, but also in all its subdirectories including those with hidden attribute set even on not using option /A for files of which long or short 8.3 name is matched by the wildcard pattern *.svn.

The two redirections >nul and 2>&1 result in redirecting the list of deleted files output to handle STDOUT (standard output) and the error messages output to handle STDERR (standard error) to the device NUL to suppress every output.

There are deleted also hard links and symbolic links matched by the wildcard pattern *.svn on using this command, but not the files linked to on having a file name not ending with .svn or being in a different directory tree.

Files matched by the wildcard pattern *.svn currently opened by a process (program/application) with using shared access permissions to deny all other processes to delete the file as long as being opened by this process are not deleted by this command. File system permissions can result also in files not being deleted by this command.

Deletion of all *.svn folders in an entire folder tree

There can be used in a Windows command prompt window the following command to remove really all folders matching in long or short 8.3 folder name the wildcard pattern *.svn in the directory %USERPROFILE%\Projects and all its subdirectories:

for /F "delims=" %I in ('dir "%USERPROFILE%\Projects\*.svn" /AD /B /S 2^>nul') do @rd /Q /S "%I" 2>nul

The same command line for usage in a batch file containing @echo off at top is:

for /F "delims=" %%I in ('dir "%USERPROFILE%\Projects\*.svn" /AD /B /S 2^>nul') do rd /Q /S "%%I" 2>nul

There is executed on more cmd.exe in background with option /c and the command line specified between ' as additional arguments to run in background the Windows Command Processor internal command DIR to search

  • in the specified directory %USERPROFILE%\Projects
  • and in all its subdirectories because of option /S
  • for just directories because of using the option /AD which includes also junctions and symbolic directory links
  • matching the wildcard pattern *.svn.

The file system entries (= directory names) matched by these criteria are output in bare format because of option /B with full path because of option /S to handle STDOUT of the background command process without surrounding " even on full directory name containing a space or one of these characters &()[]{}^=;!'+,`~. The error message output by DIR on not finding any name matching these criteria is redirected to device NUL to suppress it.

The redirection operator > must be escaped with caret character ^ on FOR command line to be interpreted as literal character when the Windows Command Processor parses this command line before executing the command FOR which executes the embedded dir command line with using a separate command process started in background.

The output list of directory names with their full paths to handle STDOUT is captured by cmd.exe processing the batch file and processed by FOR after started cmd.exe closed itself.

The FOR /F option delims= defines an empty list of string delimiters which results in each entire directory name is assigned completely one after the other to the specified loop variable I.

The command RD is executed to delete quietly because of option /Q the directory with all files and all subdirectories because of option /S.

There are deleted also junctions (soft links) and symbolic directory links matched by the wildcard pattern *.svn on using this command, but not the directories linked to on having a directory name not ending with .svn or being in a different directory tree.

A directory matched by the wildcard pattern *.svn in which a file is currently opened by a process (program/application) with using shared access permissions to deny all other processes to delete the file as long as being opened by this process is not deleted by this command and of course also no directory above the directory containing the file which cannot be deleted at the moment. File system permissions can result also in directories not being deleted by this command. Windows prevents by default also the deletion of a directory which is the current working directory of any running process.

Other useful information regarding to deletion of files and folders

The directory path %USERPROFILE%\Projects\ can be removed completely or replaced by .\ in the commands above to delete the files and folders matching the wildcard pattern *.svn in the current directory of the Windows Command Processor process which executes the commands.

The directory path %USERPROFILE%\Projects\ can be replaced by %~dp0 to delete the files and folders matching the wildcard pattern *.svn in the directory of the batch file on using the command lines above in a batch file independent on which directory is the current directory on execution of the batch file.

The directory path %USERPROFILE%\Projects\ can be replaced also by a relative path. Please read the Microsoft documentation about Naming Files, Paths, and Namespaces for more details about relative paths.

To understand the commands used and how they work, open a command prompt window, execute there the following commands, and read the displayed help pages for each command, entirely and carefully.

  • del /?
  • dir /?
  • for /?
  • rd /?

Run mklink /? for help on how to create file and directory links explained very well by MKLink.

See also:

  • Microsoft documentation for the Windows commands
  • SS64.com — A-Z index of Windows CMD commands

  • C windows prefetch можно ли удалить
  • C windows ehome msmediacenter wmserver exe
  • C windows policydefinitions inetres admx
  • C windows diagnostics system pcw код ошибки 0x80070002 как исправить
  • C windows minidump ошибка как исправить