Removing directories. Removing directories is done using the RD command. Basic cmd commands - just about useful Deleting a folder with and without confirmation

Removes a directory.

Syntax

rmdir[disk: ]way [/ s] [/ q]

rd[disk: ]way [/ s] [/ q]

Options

[disk: ]way Specifies the drive and location of the directory to delete. / s Removes the specified directory and all subdirectories along with files. Parameter / s used to delete a directory tree. / q Launches rmdir in stealth mode. The command removes directories without asking for confirmation. /? Displays command line help.

Notes (edit)

  • Using the command rmdir in the recovery console

    Command rmdir with different parameters is available in the Recovery Console.

  • Removing directories with hidden and system files

    It is not possible to delete directories with hidden and system files. When trying to uninstall, the following message appears:

    The directory is not empty.

    To get a list of hidden and system files, use the command dir, and to view and change attributes, use the command attrib... For more information, click on the "" link.

  • Using backslashes

    If a backslash (\) is inserted before the first directory name, that directory will be treated as a subdirectory of the root directory, regardless of the name of the current directory. If there is no backslash, the directory will be treated as a subdirectory of the current directory.

  • Deleting the current directory

    Command rmdir cannot be used to delete the current directory. First, you need to change to another directory (which is not a subdirectory of the current one) and then use the command rmdir... When trying to delete the current directory, the following message appears:

    The file cannot be accessed because it is being used by another process.

Examples of

To remove the \ User \ Smith directory, you first need to make sure it contains no files. To do this, type in the command line:

dir \ user \ smith / a

Only the characters "." Should be displayed on the screen. and "..".

Then, from any directory other than \ User \ Smith, run the following command:

rmdir \ user \ smith

Use the following command to remove the \ User directory, all files and all subdirectories.

DEL command

DEL attributes]] names

ERASE attributes]] names

Names The names of one or more files. Wildcards are used to delete multiple files at once.

If a directory is specified, all files will be removed from it.

/ P Prompt for confirmation before deleting each file.

/ F Force the deletion of read-only files.

/ S Removes the specified files from all subdirectories.

/ Q Disable the confirmation prompt when deleting files.

/ A Select files for deletion by attributes.

Attributes S System files R Read-only

H Hidden files A Files to be archived

The prefix "-" is NOT

Changes to DEL and ERASE commands when extended command processing is enabled:

The output for the / S switch is reversed, that is, only names are printed deleted files rather than files that could not be found.

Example: 1. Deleting all files with extension .txt

A: Jobs> del * .txt

A: Quests>

2. Deleting files starting with the letter "T"

A: Jobs> del T * .txt

A: Quests>

RMDIR / Q / R / S] [@file] path ...

pathThe name of one or more subdirectories to remove.
@fileA text file containing the names of the directories to remove, one per line (see@file lists for details).

File Completion Syntax:

RD sets two internal variables:

% _rd_dirsThe number of directories deleted
% _rd_errorsThe number of errors

(Note that if you do an RD / S, the actual deletions are done by DEL, so check the DEL variables.)

Options:

/ I "text"Select directories by matching text in their descriptions. The text can include wildcards and extended wildcards. The search text must be enclosed in double quotes, and must follow the/ I immediately, with no intervening spaces. You can select all filenames that have a description with/ I "[?] *" , or all filenames that do not have a description with/ I "" ... Do not use / I with @file lists. See @file lists for details.
/ KWhen used with the / S option, this will physically delete files instead of sending them to the Windows Recycle Bin, even if you have the Delete to Recycle Bin configuration option set.

OPERATING SYSTEM MS DOS

Methodical instructions for laboratory work at the rate

"Operating systems" for students of the specialty 230401 " Information Systems»

Balakovo

purpose of work- Acquisition of basic practical skills when working with the MS-DOS operating system.

Basic concepts

Any operating system (OS) provides the user and application programs with a means of communication (interface) with multiple computer devices. It receives various commands from the user and executes them. Application programs, being launched by the user (again, not without the help of the OS), themselves actively use the services of the OS. For example, if you need to print on a printer Text Document, then text editor, in the window of which this document is located, will not directly interact with the printer itself, but will delegate this work operating system... That, in turn, will check: whether the printer is on, whether it is working properly, whether its tray is loaded with paper. And only after that it will feed the text for printing in certain portions, constantly observing the state of the operating printer. There is a wide variety of operating systems: MS-DOS, Windows 7, Windows 2003, Linux, Unix and many others. They differ from each other in capabilities, usability, performance and other characteristics.

MS-DOS stands for MicroSoft Disk Operating System, i.e. disk operating system of the American company Microsoft. The term "disk" means that the OS is located on the disk: either on the hard drive, or on

from a floppy disk (MS-DOS sizes allow this), or even on a CD.

The algorithm for choosing a particular device is set in the BIOS. For example, if in the BIOS FEATURES SETUP section, BIOS setup) "In the" Boot Sequence "item lists drives A :, C :, which means the following: if a floppy disk is installed in the computer (drive A :), an attempt will be made to boot MS-DOS from it, if there is no floppy disk, then MS-DOS will boot from the hard drive (drive C :).

Operating room MS-DOS system consists of the following parts:

1) BIOS (Basic Input-Output System). This part of the OS is hardwired into ROM or ROM (Read Only Memory). The BIOS contains tests for checking the nodes of the computer (they are automatically launched when the computer is turned on), as well as the Boot Loader, a small program for calling the more complex MS-DOS Loader (a fragment of the io.sys file). In addition, the BIOS performs low-level I / O operations (at the register level) with the monitor, keyboard, disks, and printer.

2) Disk files io.sys and msdos. sys. The io.sys file (located in the start sector system disk) contains, as mentioned, the MS-DOS Loader program. In addition, io.sys complements the BIOS with other low-level I / O operations. The msdos.sys file provides basic high-level MS-DOS services.

3) File command.com - Command processor or MS-DOS command interpreter. Contains basic MS-DOS commands: CLS, DIR, COPY and others, called internal. In addition, it works with external MS-DOS commands such as FORMAT, DELTREE and others, which are usually located in the DOS directory and are files with the extension .com or .exe. The command.com command processor organizes the execution of any user commands entered from the keyboard or using command files (files with the .bat extension). The MS-DOS components listed above are the minimum components of this operating system. In addition to it, you can specify such MS-DOS elements as:

4) external MS-DOS commands. They are, as mentioned, files with the .com or .exe extension and are usually located in the DOS directory.

5) Drivers. it special programs(files with the extensions .com,. exe, or .sys), providing service to new or non-standard use of existing external devices... Revitalization required drivers is done using the config.sys and autoexec.bat files.

6) The config.sys file. It is an ordinary text file containing special commands for activating various drivers. In addition, it can be used to change the operating modes or configuration of MS-DOS.

7) The autoexec.bat file. it batch file, automatically launched by the operating system for execution when the computer is turned on or restarted.

The user's dialogue with DOS is carried out in the form of commands entered in response to the so-called operating system prompt. It is displayed on the display screen and usually looks like this:

current disk name: \ current directory name> _,

where> is a system symbol;

For example, C: \ lab> _,

where C is the name of the current disk;

lab - the name of the current directory

If the current directory is the root, then the name of the current directory is omitted, since it is the same as the name of the current drive. The prompt in this case looks like this:

C: \> _

Entering commands. DOS includes several dozen commands. They are typed on the command line at the DOS prompt. The syntax or general format for a command is as follows:

command name [arguments],

where arguments are objects that the command operates on;

parameters are identifiers of command execution modes (they are separated by a slash "/").

To display the arguments and parameters of a command, run the command help command name

To execute any command, press the Enter key (no further indication of pressing the Enter key will be indicated).

The main DOS commands are conventionally divided into four groups.

1. Commands of general purpose.

2. Commands for working with disks.

3. Commands for working with directories.

4. Commands for working with files.

Disk management commands are not used in this lab, so they are not covered further.

MS-DOS has standard file type conventions that allow you to visually define the nature of files.

COM - command file;

EXE - executable file;

BAT - batch file;

SYS - system file;

TXT - text file

General purpose commands.

The most commonly used commands in this group are:

1) cls (Clear Screen) - clear the screen;

2) ver– output of the version of the operating system installed on the computer;

3) date - output and installation current date;

4) time– display and setting of the current time;

5) help– display of help data on DOS commands;

You can use the following keys to call previously entered commands into the command line and manage the list of commands:

- calling the previous command;

↓ - call the next command;

F7– display of a list of previously entered commands;

F9– copying to the command line one of the commands of the displayed list (F7) by selecting its number;

Alt + F7– clear the command list.

Directory Commands

Command DIR- directory - directory (directories) - is used to display a list of files and subdirectories located in the specified directory.

For example, C: \> dir - view the root directory of the C drive.

C: \> dir lab - view the contents of the lab directory.

If the specified directory contains a large number of subdirectories and files, then you can organize their page-by-page output using the / P switch. In this case, after displaying one page of the list, DOS will wait for any key press to continue displaying the next pages. For example, dir c: \ windows / p

!! Browse the contents of the root directory of the C: drive using page-by-page browsing.

Command TREE- displaying the directory tree on the screen.

Command format: TREE[drive] [path] [name] [| more]

where disk is the name of the disk that hosts the directory system;

path - the path to the directory whose tree you want to view;

name - the name of this directory;

/ f - the mode of displaying the directory tree with the files they contain;

| more - command for pipelining output in portions of 23 lines.

For example, C: /> tree C: / f | more

!! Display the directory tree of the C: drive in portions of 23 lines without files.

Command MD- Make Directory - create directories and subdirectories.

Command format: MD [drive] [path] name

where disk is the name of the disk on which the directory is created;

path - the path to the created directory from the root or current directory;

name - the name of the directory to be created.

For example, C: /> md lab

!! Create an X directory on the C: drive.

Command CD- Change Directory - change the current directory.

Command format: CD [path] name

where path is the path to a subdirectory in the hierarchical file structure;

name - the name of the subdirectory to be declared current.

For example, cd C: \ Windows

To return to the root directory from the current subdirectory of any level, you must enter the command cd \

If you need to move up one level, you must enter the command cd ..

Here (..) stands for parent directory.

!! Change to directory X. Notice the changes at the DOS prompt.

!! Create two subdirectories Y and Z in the current directory.

Change the current disc. To change the current disk, you need to type the name of the drive, which should become the current one. After executing this command, a DOS prompt will appear with the current drive.

Copying directories. To copy one directory to another, use the command XCOPY... This command makes it possible to copy a directory with a change in its name.

Command format:

where
where
XCOPY [drive] [path] old_name [drive] [path] old (new) name

where / s - copy mode of non-empty directories (together with files and subdirectories);

/ e - mode for copying empty directories.

For example, we copy directory 1 to directory 2 under the name 3

xcopy d: \ x \ 1 d \ x \ 2 \ 3 / s / e (do not type - this is an example)

!! Copy directory Z to directory Y under the name Q. Check the result with the TREE command.

Moving directories... To move directories, use the command MOVE.

Command format:

MOVE [drive] [path] old_name [drive] [path] [new_name]

When transferring a directory to the current directory, it is necessary to specify either the new (old) name of the transferred directory or the full path to the current directory in the "where" part of the address.

For example, see the command is similar to the example above

!! Change to the root directory, then move the Q directory to the X directory. Verify the result by displaying the X directory tree.

Renaming directories. The directory name is changed using the command REN.

Command format: REN [drive] [path] name1 name2

where name1 is the old directory name;

name2– the new name of the directory.

!! Name X directory W. Verify command execution.

Removing directories. Removing directories is done using the RD command.

Command format: RD[drive] [path] name

where disk is the name of the disk where the directory to be deleted is located;

path - the path to the directory to be deleted;

name - the name of the directory to be deleted.

You can delete a directory only from outside the directory. The root directory cannot be deleted. After pressing Enter, the operating system will prompt: Delete directory "[drive] [path] name" along with all subdirectories? ... To delete, you must press Y (yes) and Enter, to cancel - N (no) and Enter.

!! Delete directory Y. Verify the execution of the delete command using the TREE command.

File Commands

Why is the world so chaotic? Because the administrator of our system has forgotten about fulfilling his duties. Or just lost the list of cmd commands from our world. Although this is a somewhat original view of the existing order of things, it nevertheless reflects part of the truth we need: using the command line, you can easily put things in order in your computer:

What is the command line

The command line is the simplest tool for managing your computer's operating system. Control is carried out using a number of reserved commands and a set of characters of the text keyboard without the participation of the mouse ( in Windows operating system).

In systems on UNIX based when working with command line use of a mouse is possible.

Some of the commands came to us from MS-DOS. The command line is also called the console. It is used not only to administer the operating system, but also to manage common programs. Most often, this set of commands includes the most rarely used.

The advantage of using basic cmd commands is that it uses a minimum of system resources. And this is important in case of emergencies, when all the power of the computer, one way or another, is involved.

In cmd, the ability to execute and create entire batch files is implemented, which is a certain order of execution of a number of commands (scripts). Thanks to this, they can be used to automate the execution of certain tasks ( account management, data archiving and more).

The Windows command shell for manipulating and redirecting commands to specific utilities and operating system tools is the Cmd.exe interpreter. It loads the console and redirects commands in a system-understandable format.

Working with the command line in the Windows operating system

You can call the console in Windows in several ways:

Both methods involve launching the console as the current user. That is, with all the rights and restrictions that are imposed on its role in the operating system. To run cmd with administrator rights, you need to select the program icon in the Start menu and in context menu select the appropriate item:

After running the utility, you can get background information about commands and their format in the console. To do this, you need to enter the operator help and press "Enter":

Basic commands for working with files and directories

The most commonly used commands are:

  • RENAME - renaming directories and files. Command syntax:

RENAME | REN [drive / path] original file / directory name | final filename
Example: RENAME C: UsershomeDesktoptost.txt test.txt

  • DEL (ERASE) - Used to delete only files, not directories. Its syntax is:

DEL | ERASE [processing method] [filename]
Example: Del C: UsershomeDesktoptest.txt / P

The processing method means a special flag that allows you to implement a certain condition when deleting a file. In our example, the "P" flag turns on the output of the permission dialog for deleting each file:

For more information about the possible values ​​of the "processing method" parameter, refer to the technical documentation for the Windows operating system.

MD [drive:] [path]
Example:
MD C: UsershomeDesktoptest1test2

The example will create a subfolder test2 in the test1 folder. If one of the root folders of the path does not exist, then it will also be created:

  • RD ( RMDIR) - deletes a specific folder or all directories in the specified path. Syntax:

RD | RMDIR [processing_key] [drive / path]
Example:
rmdir / s C: UsershomeDesktoptest1test2

The example uses the s flag, which will cause the entire directory branch specified in the path to be deleted. Therefore, you should not use the rmdir command with this processing switch unnecessarily.

In the next section, we'll take a closer look at network cmd commands.

Networking Commands

The command line allows you to control not only file system PC, but also its networking capabilities. The console network commands include a large number of operators to monitor and test the network. The most relevant ones are:

  • ping - the command is used to monitor the capabilities network connection PC. Remote computer a set number of packets are sent and then sent back to them. Packet transmission time and loss percentage are taken into account. Syntax:

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v type] [-r count] [-s count] [(-j hostlist | - k hostlist)] [-w int] [target_PC_name]

Example of command implementation:
ping example.microsoft.com
ping –w 10000 192.168.239.132

In the last example of the cmd ping command, a request is sent to the recipient with the specified IP address. The waiting interval between packets is 10,000 (10 sec). By default, this parameter is set to 4000:

  • tracert - serves to determine the network path to the specified resource by sending a special echo message through the protocol
  • ICMP (Control Message Protocol). After running the command with parameters, a list of all routers through which the message path passes is displayed. The first item in the list is the first router from the side of the requested resource.

The syntax for the tracer cmd command is:
tracert [-d] [-h max_transitions] [-j hostlist] [-w int] [target_source_name]
Implementation example:
tracert -d -h 10 microsoft.com

The example traces the route to the specified resource. This increases the speed of the operation by using the d parameter, which prevents the command from attempting to obtain permission to read IP addresses. The number of transitions (jumps) is limited to 10 using the set value of the parameter h. By default, the number of jumps is 30:

shutdown [(-l | -s | -r | -a)] [-f] [-m [\ PCName]] [-t xx] [-c "messages"] [-d [u] [p]: xx: yy]
Example:
shutdown / s / t 60 / f / l / m \ 191.162.1.53

The remote PC (m) with the specified IP address (191.162.1.53) will shutdown (s) after 60 seconds (t). This will force exit from all applications (f) and the session of the current user (l).

2021 wisemotors.ru. How it works. Iron. Mining. Cryptocurrency.