Using windows command prompt windows 7

There are more than 230 Command Prompt commands in Windows 7. They are referred to as CMD commands or DOS commands.
Command Description Append The append command can be used by programs to open files in another directory as if they were located in the current directory. The append command is not available in 64-bit versions of Windows 7. Arp The arp command is used to display or change entries in the ARP cache. Assoc The assoc command is used to display or change the file type associated with a particular file extension. At The at command is used to schedule commands and other programs to run at a specific date and time. Attrib The attrib command is used to change the attributes of a single file or a directory. Auditpol The auditpol command is used to display or change audit policies. Bcdboot The bcdboot command is used to copy boot files to the system partition and to create a new system BCD store. Bcdedit The bcdedit command is used to view or make changes to Boot Configuration Data. Bdehdcfg The bdehdcfg command is ed to prepare a hard drive for BitLocker Drive Encryption. Bitsadmin The bitsadmin command is used to create, manage, and monitor download and upload jobs. While the bitsadmin command is available in Windows 7, it is being phased out. The BITS PowerShell cmdlets should be used instead. Bootcfg The bootcfg command is used to build, modify, or view the contents of the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located. Bootcfg is available in Windows 7 but it serves no real value since boot.ini is not used in these operating systems. The bcdedit command should be used instead. Bootsect The bootsect command is used to configure the master boot code to one compatible with BOOTMGR (Windows 7) or NTLDR (Windows XP and earlier). The bootsect command is only from the Command Prompt available in System Recovery Options. Break The break command sets or clears extended CTRL+C checking on DOS systems. The break command is available in Windows 7 to provide compatibility with MS-DOS files but it has no effect in Windows itself. Cacls The cacls command is used to display or change access control lists of files. The cacls command is being phased out in favor of the icacls command, which should be used instead. Call The call command is used to run a script or batch program from within another script or batch program. The call command has no effect outside of a script or batch file. In other words, running the call command at the Command Prompt or MS-DOS prompt will do nothing. Cd The cd command is the shorthand version of the chdir command. Certreq The certreq command is used to perform various certification authority (CA) certificate functions. Certutil The certutil command is used to dump and display certification authority (CA) configuration information in addition to other CA functions. Change The change command changes various terminal server settings like install modes, COM port mappings, and logons. Chcp The chcp command displays or configures the active code page number. Chdir The chdir command is used to display the drive letter and folder that you are currently in. Chdir can also be used to change the drive and/or directory that you want to work in. Chglogon The chglogon command enables, disables, or drains terminal server session logins. Executing the chglogon command is the same as executing change logon. Chgport The chgport command can be used to display or change COM port mappings for DOS compatibility. Executing the chgport command is the same as executing change port. Chgusr The chgusr command is used to change the install mode for the terminal server. Executing the chgusr command is the same as executing change user. Chkdsk The chkdsk command, often referred to as check disk, is used to identify and correct certain hard drive errors. Chkntfs The chkntfs command is used to configure or display the checking of the disk drive during the Windows boot process. Choice The choice command is used within a script or batch program to provide a list of choices and return the value of that choice to the program. Cipher The cipher command shows or changes the encryption status of files and folders on NTFS partitions. Clip The clip command is used to redirect the output from any command to the clipboard in Windows. Cls The cls command clears the screen of all previously entered commands and other text. Cmd The cmd command starts a new instance of the cmd.exe command interpreter. Cmdkey The cmdkey command is used to show, create, and remove stored user names and passwords. Cmstp The cmstp command installs or uninstalls a Connection Manager service profile. Color The color command is used to change the colors of the text and background within the Command Prompt window. Command The command command starts a new instance of the command.com command interpreter. The command command is not available in 64-bit versions of Windows 7. Comp The comp command is used to compare the contents of two files or sets of files. Compact The compact command is used to show or change the compression state of files and directories on NTFS partitions. Convert The convert command is used to convert FAT or FAT32 formatted volumes to the NTFS format. Copy The copy command does simply that — it copies one or more files from one location to another. The xcopy command is considered to be a more «powerful» version of the copy command. Cscript The cscript command is used to execute scripts via Microsoft Script Host. The cscript command is most popularly used to manage printers from the command line using scripts like prncnfg.vbs, prndrvr.vbs, prnmngr.vbs, and others. Date The date command is used to show or change the current date. Debug The debug command starts Debug, a command line application used to test and edit programs. The debug command is not available in 64-bit versions of Windows 7. Defrag The defrag command is used to defragment a drive you specify. The defrag command is the command line version of Microsoft’s Disk Defragmenter. Del The del command is used to delete one or more files. The del command is the same as the erase command. Diantz The diantz command is used to losslessly compress one or more files. The diantz command is sometimes called Cabinet Maker. The diantz command is the same as the makecab command. Dir The dir command is used to display a list of files and folders contained inside the folder that you are currently working in. The dir command also displays other important information like the hard drive’s serial number, the total number of files listed, their combined size, the total amount of free space left on the drive, and more. Diskcomp The diskcomp command is used to compare the contents of two floppy disks. Diskcopy The diskcopy command is used to copy the entire contents of one floppy disk to another. Diskpart The diskpart command is used to create, manage, and delete hard drive partitions. Diskperf The diskperf command is used to manage disk performance counters remotely. Diskraid The diskraid command starts the DiskRAID tool which is used to manage and configure RAID arrays. Dism The dism command starts the Deployment Image Servicing and Management tool (DISM). The DISM tool is used to manage features in Windows images. Dispdiag The dispdiag command is used to output a log of information about the display system. Djoin The djoin command is used to create a new computer account in a domain. Doskey The doskey command is used to edit command lines, create macros, and recall previously entered commands. Dosx The dosx command is used to start DOS Protected Mode Interface (DPMI), a special mode designed to give MS-DOS applications access to more than the normally allowed 640 KB. The dosx command is not available in 64-bit versions of Windows 7. The dosx command and DPMI is only available in Windows 7 to support older MS-DOS programs. Driverquery The driverquery command is used to show a list of all installed drivers. Echo The echo command is used to show messages, most commonly from within script or batch files. The echo command can also be used to turn the echoing feature on or off. Edit The edit command starts the MS-DOS Editor tool which is used to create and modify text files. The edit command is not available in 64-bit versions of Windows 7. Edlin The edlin command starts the Edlin tool which is used to create and modify text files from the command line. The edlin command is not available in 64-bit versions of Windows 7. Endlocal The endlocal command is used to end the localization of environment changes inside a batch or script file. Erase The erase command is used to delete one or more files. The erase command is the same as the del command. Esentutl The esentutl command is used to manage Extensible Storage Engine databases. Eventcreate The eventcreate command is used to create a custom event in an event log. Exe2bin The exe2bin command is used to convert a file of the EXE file type (executable file) to a binary file. The exe2bin command is not available in any 64-bit version of Windows 7. Exit The exit command is used to end the cmd.exe (Windows) or command.com (MS-DOS) session that you’re currently working in. Expand The expand command is used to extract the files and folders contained in Microsoft Cabinet (CAB) files. Extrac32 The extrac32 command is used to extract the files and folders contained in Microsoft Cabinet (CAB) files. The extrac32 command is actually a CAB extraction program for use by Internet Explorer but can be used to extract any Microsoft Cabinet file. Use the expand command instead of the extrac32 command if possible. Fastopen The fastopen command is used to add a program’s hard drive location to a special list stored in memory, potentially improving the program’s launch time by removing the need for MS-DOS to locate the application on the drive. The fastopen command is not available in 64-bit versions of Windows 7. Fastopen is only available in Windows 7 to support older MS-DOS files. Fc The fc command is used to compare two individual or sets of files and then show the differences between them. Find The find command is used to search for a specified text string in one or more files. Findstr The findstr command is used to find text string patterns in one or more files. Finger The finger command is used to return information about one or more users on a remote computer that’s running the Finger service. Fltmc The fltmc command is used to load, unload, list, and otherwise manage Filter drivers. For The for command is used to run a specified command for each file in a set of files. The for command is most often used within a batch or script file. Forfiles The forfiles command selects one or more files to execute a specified command on. The forfiles command is most often used within a batch or script file. Format The format command is used to format a drive in the file system that you specify. Drive formatting is also available from Disk Management. Fsutil The fsutil command is used to perform various FAT and NTFS file system tasks like managing reparse points and sparse files, dismounting a volume, and extending a volume. Ftp The ftp command can used to transfer files to and from another computer. The remote computer must be operating as an FTP server. Ftype The ftype command is used to define a default program to open a specified file type. Getmac The getmac command is used to display the media access control (MAC) address of all the network controllers on a system. Goto The goto command is used in a batch or script file to direct the command process to a labeled line in the script. Gpresult The gpresult command is used to display Group Policy settings. Gpupdate The gpupdate command is used to update Group Policy settings. Graftabl The graftabl command is used to enable the ability of Windows to display an extended character set in graphics mode. The graftabl command is not available in 64-bit versions of Windows 7. Graphics The graphics command is used to load a program that can print graphics. The graphics command is not available in 64-bit versions of Windows 7. Help The help command provides more detailed information on any of the other Command Prompt or MS-DOS commands. Hostname The hostname command displays the name of the current host. Hwrcomp The hwrcomp command is used to compile custom dictionaries for handwriting recognition. Hwrreg The hwrreg command is used to install a previously compiled custom dictionary for handwriting recognition. Icacls The icacls command is used to display or change access control lists of files. The icacls command is an updated version of the cacls command. If The if command is used to perform conditional functions in a batch file. Ipconfig The ipconfig command is used to display detailed IP information for each network adapter utilizing TCP/IP. The ipconfig command can also be used to release and renew IP addresses on systems configured to receive them via a DHCP server. Irftp The irftp command is used to transmit files over an infrared link. Iscsicli The iscsicli command starts the Microsoft iSCSI Initiator, used to manage iSCSI. Kb16 The kb16 command is used to support MS-DOS files that need to configure a keyboard for a specific language. The kb16 command is not available in 64-bit versions of Windows 7. The kb16 command only exists to support older MS-DOS files. Klist The klist command is used to list Kerberos service tickets. The klist command can also be used to purge Kerberos tickets. Ksetup The ksetup command is used to configure connections to a Kerberos server. Ktmutil The ktmutil command starts the Kernel Transaction Manager utility. Label The label command is used to manage the volume label of a disk. Loadfix The loadfix command is used to load the specified program in the first 64K of memory and then runs the program. The loadfix command is not available in 64-bit versions of Windows 7. Lodctr The lodctr command is used to update registry values related to performance counters. Logman The logman command is used to create and manage Event Trace Session and Performance logs. The logman command also supports many functions of Performance Monitor. Logoff The logoff command is used to terminate a session. Lpq The lpq command displays the status of a print queue on a computer running Line Printer Daemon (LPD). The lpq command is not available by default in Windows 7 but can be enabled by turning on the LPD Print Service and LPR Port Monitor features from Programs and Features in Control Panel. Lpr The lpr command is used to send a file to a computer running Line Printer Daemon (LPD). The lpr command is not available by default in Windows 7 but can be enabled by turning on the LPD Print Service and LPR Port Monitor features from Programs and Features in Control Panel. Makecab The makecab command is used to losslessly compress one or more files. The makecab command is sometimes called Cabinet Maker. The makecab command is the same as the diantz command. Manage-bde The manage-bde command is used to configure BitLocker Drive Encryption from the command line. Md The md command is the shorthand version of the mkdir command. Mem The mem command shows information about used and free memory areas and programs that are currently loaded into memory in the MS-DOS subsystem. The mem command is not available in 64-bit versions of Windows 7. Mkdir The mkdir command is used to create a new folder. Mklink The mklink command is used to create a symbolic link. Mode The mode command is used to configure system devices, most often COM and LPT ports. Mofcomp   More The more command is used to display the information contained in a text file. The more command can also be used to paginate the results of any other Command Prompt or MS-DOS command. Mount The mount command is used to mount Network File System (NFS) network shares. The mount command is not available by default in Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. Mountvol The mountvol command is used to display, create, or remove volume mount points. Move The move command is used to move one or files from one folder to another. The move command is also used to rename directories. Mrinfo The mrinfo command is used to provide information about a router’s interfaces and neighbors. Msg The msg command is used to send a message to a user. Msiexec The msiexec command is used to start Windows Installer, a tool used to install and configure software. Muiunattend The muiunattend command starts the Multilanguage User Interface unattended setup process. Nbtstat The nbtstat command is used to show TCP/IP information and other statistical information about a remote computer. Net The net command is used to display, configure, and correct a wide variety of network settings. Net1 The net1 command is used to display, configure, and correct a wide variety of network settings. The net command should be used instead of the net1 command. The net1 command was made available in Windows NT and Windows 2000 as a temporary fix for a Y2K issue that the net command had, which was corrected before the release of Windows XP. The net1 command remains in later versions of Windows only for compatibility with older programs and scripts that utilized the command. Netcfg The netcfg command is used to install the Windows Preinstallation Environment (WinPE), a lightweight version of Windows used to deploy workstations. Netsh The netsh command is used to start Network Shell, a command-line utility used to manage the network configuration of the local, or a remote, computer. Netstat The netstat command is most commonly used to display all open network connections and listening ports. Nfsadmin The nfsadmin command is used to manage Server for NFS or Client for NFS from the command line. The nfsadmin command is not available by default in Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The nfsadmin command is not available in Windows 8 because Service for UNIX (SFU) was discontinued. Nlsfunc The nlsfunc command is used to load information specific to a particular country or region. The nlsfunc command is not available in 64-bit versions of Windows 7. Nlsfunc is only available in Windows 7 to support older MS-DOS files. Nltest The nltest command is used to test secure channels between Windows computers in a domain and between domain controllers that are trusting other domains. Nslookup The nslookup is most commonly used to display the hostname of an entered IP address. The nslookup command queries your configured DNS server to discover the IP address. Ocsetup The ocsetup command starts the Windows Optional Component Setup tool, used to install additional Windows features. Openfiles The openfiles command is used to display and disconnect open files and folders on a system. Path The path command is used to display or set a specific path available to executable files. Pathping The pathping command functions much like the tracert command but will also report information about network latency and loss at each hop. Pause The pause command is used within a batch or script file to pause the processing of the file. When the pause command is used, a «Press any key to continue…» message displays in the command window. Ping The ping command sends an Internet Control Message Protocol (ICMP) Echo Request message to a specified remote computer to verify IP-level connectivity. Pkgmgr The pkgmgr command is used to start the Windows Package Manager from the Command Prompt. Package Manager installs, uninstalls, configures, and updates features and packages for Windows. Pnpunattend The pnpunattend command is used to automate the installation of hardware device drivers. Pnputil The pnputil command is used to start the Microsoft PnP Utility, a tool used to install a Plug and Play device from the command line. Popd The popd command is used to change the current directory to the one most recently stored by the pushd command. The popd command is most often utilized from within a batch or script file. Powercfg The powercfg command is used to manage the Windows power management settings from the command line. Print The print command is used to print a specified text file to a specified printing device. Prompt The prompt command is used to customize the appearance of the prompt text in Command Prompt or MS-DOS. Pushd The pushd command is used to store a directory for use, most commonly from within a batch or script program. Qappsrv The qappsrv command is used to display all Remote Desktop Session Host servers available on the network. Qprocess The qprocess command is used to display information about running processes. Query The query command is used to display the status of a specified service. Quser The quser command is used to display information about users currently logged on to the system. Qwinsta The qwinsta command is used to display information about open Remote Desktop Sessions. Rasautou The rasautou command is used to manage Remote Access Dialer AutoDial addresses. Rasdial The rasdial command is used to start or end a network connection for a Microsoft client. Rcp The rcp command is used to copy files between a Windows computer and a system running the rshd daemon. The rcp command is not available by default in Windows 7 but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here. Rd The rd command is the shorthand version of the rmdir command. Rdpsign The rdpsign command is used to sign a Remote Desktop Protocol (RDP) file. Reagentc The reagentc command is used to configure the Windows Recovery Environment (RE). Recover The recover command is used to recover readable data from a bad or defective disk. Reg The reg command is used to manage the Windows Registry from the command line. The reg command can perform common registry functions like adding registry keys, exporting the registry, etc. Regini The regini command is used to set or change registry permissions and registry values from the command line. Regsvr32 The regsvr32 command is used to register a DLL file as a command component in the Windows Registry. Relog The relog command is used to create new performance logs from data in existing performance logs. Rem The rem command is used to record comments or remarks in a batch or script file. Ren The ren command is the shorthand version of the rename command. Rename The rename command is used to change the name of the individual file that you specify. Repair-bde The repair-bde command is used to repair or decrypt a damaged drive that’s been encrypted using BitLocker. Replace The replace command is used to replace one or more files with one or more other files. Reset The reset command, executed as reset session, is used to reset the session subsystem software and hardware to known initial values. Rmdir The rmdir command is used to delete an existing or completely empty folder. Robocopy The robocopy command is used to copy files and directories from one location to another. This command is also called Robust File Copy. The robocopy command is superior to both the copy command and the xcopy command because robocopy supports many more options. Route The route command is used to manipulate network routing tables. Rpcinfo The rpcinfo command makes a remote procedure call (RPC) to an RPC server and reports what it finds. The rpcinfo command is not available by default in Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. Rpcping The rpcping command is used to ping a server using RPC. Rsh The rsh command is used to run commands on remote computers running the rsh daemon. The rsh command is not available by default in Windows 7 but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here. Runas The runas command is used to execute a program using another user’s credentials. Rwinsta The rwinsta command is the shorthand version of the reset session command. Sc The sc command is used to configure information about services. The sc command communicates with the Service Control Manager. Schtasks The schtasks command is used to schedule specified programs or commands to run at certain times. The schtasks command can be used to create, delete, query, change, run, and end scheduled tasks. Sdbinst The sdbinst command is used to deploy customized SDB database files. Secedit The secedit command is used to configure and analyze system security by comparing the current security configuration to a template. Set The set command is used to display, enable, or disable environment variables in MS-DOS or from the Command Prompt. Setlocal The setlocal command is used to start the localization of environment changes inside a batch or script file. Setspn The setspn command is used to manage the Service Principal Names (SPN) for an Active Directory (AD) service account. Setver The setver command is used to set the MS-DOS version number that MS-DOS reports to a program. The setver command is not available in 64-bit versions of Windows 7. Setx The setx command is used to create or change environment variables in the user environment or the system environment. Sfc The sfc command is used to verify and replace important Windows system files. The sfc command is also referred to as System File Checker or Windows Resource Checker depending on the operating system. Shadow The shadow command is used to monitor another Remote Desktop Services session. Share The share command is used to install file locking and file sharing functions in MS-DOS. The share command is not available in 64-bit versions of Windows 7. Share is only available in Windows 7 to support older MS-DOS files. Shift The shift command is used to change the position of replaceable parameters in a batch or script file. Showmount The showmount command is used to display information about NFS mounted file systems. The showmount command is not available by default in Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. Shutdown The shutdown command can be used to shut down, restart, or log off the current system or a remote computer. Sort The sort command is used to read data from a specified input, sort that data, and return the results of that sort to the Command Prompt screen, a file, or another output device. Start The start command is used to open a new command line window to run a specified program or command. The start command can also be used to start an application without creating a new window. Subst The subst command is used to associate a local path with a drive letter. The subst command is a lot like the net use command except a local path is used instead of a shared network path. Sxstrace The sxstrace command is used to start the WinSxs Tracing Utility, a programming diagnostic tool. Systeminfo The systeminfo command is used to display basic Windows configuration information for the local or a remote computer. Takeown The takedown command is used to regain access to a file that an administrator was denied access to when reassigning ownership of the file. Taskkill The taskkill command is used to terminate a running task. The taskkill command is the command line equivalent of ending a process in Task Manager in Windows. Tasklist Displays a list of applications, services, and the Process ID (PID) currently running on either a local or a remote computer. Tcmsetup The tcmsetup command is used to set up or disable the Telephony Application Programming Interface (TAPI) client. Telnet The telnet command is used to communicate with remote computers that use the Telnet protocol. The telnet command is not available by default in Windows 7 but can be enabled by turning on the Telnet Client Windows feature from Programs and Features in Control Panel. Tftp The tftp command is used to transfer files to and from a remote computer that’s running the Trivial File Transfer Protocol (TFTP) service or daemon. The tftp command is not available by default in Windows 7 but can be enabled by turning on the TFTP Client Windows feature from Programs and Features in Control Panel. Time The time command is used to show or change the current time. Timeout The timeout command is typically used in a batch or script file to provide a specified timeout value during a procedure. The timeout command can also be used to ignore keypresses. Title The title command is used to set the Command Prompt window title. Tlntadmn The tlntadmn command is used to administer a local or remote computer running Telnet Server. The tlntadmn command is not available by default in Windows 7 but can be enabled by turning on the Telnet Server Windows feature from Programs and Features in Control Panel. Tracerpt The tracerpt command is used to process event trace logs or real-time data from instrumented event trace providers. Tracert The tracert command sends Internet Control Message Protocol (ICMP) Echo Request messages to a specified remote computer with increasing Time to Live (TTL) field values and displays the IP address and hostname, if available, of the router interfaces between the source and destination. Tree The tree command is used to graphically display the folder structure of a specified drive or path. Tscon The tscon command is used to attach a user session to a Remote Desktop session. Tsdiscon The tsdiscon command is used to disconnect a Remote Desktop session. Tskill The tskill command is used to end the specified process. Type The type command is used to display the information contained in a text file. Typeperf The typerperf command displays performance data in the Command Prompt window or writes the data to a specified log file. Tzutil The tzutil command is used to display or configure the current system’s time zone. The tzutil command can also be used to enable or disable Daylight Saving Time adjustments. Umount The umount command is used to remove Network File System (NFS) mounted network shares. The umount command is not available by default in Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. Unlodctr The unlodctr command removes Explain text and Performance counter names for a service or device driver from the Windows Registry. Vaultcmd The vaultcmd command is used to create, remove, and show stored credentials. Ver The ver command is used to display the current Windows or MS-DOS version number. Verify The verify command is used to enable or disable the ability of Command Prompt, or MS-DOS, to verify that files are written correctly to a disk. Vol The vol command shows the volume label and the serial number of a specified disk, assuming this information exists. Vssadmin The vssadmin command starts the Volume Shadow Copy Service administrative command line tool which displays current volume shadow copy backups and all installed shadow copy writers and providers. W32tm The w32tm command is used to diagnose issues with Windows Time. Waitfor The waitfor command is used to send or wait for a signal on a system. Wbadmin The wbadmin command is used to start and stop backup jobs, display details about a previous backup, list the items within a backup, and report on the status of a currently running backup. Wecutil The wecutil command is used to manage subscriptions to events that are forwarded from WS-Management supported computers. Wevtutil The wevtutil command starts the Windows Events Command Line Utility which is used to manage event logs and publishers. Where The where command is used to search for files that match a specified pattern. Whoami The whoami command is used to retrieve user name and group information on a network. Winmgmt The winmgmt command starts the command line version of WMI (Windows Management Instrumentation), a scripting tool in Windows. Winrm The winrm command is used to start the command line version of Windows Remote Management, used to manage secure communications with local and remote computers using web services. Winrs The winrs command is used to open a secure command window with a remote host. Winsat The winsat command starts the Windows System Assessment Tool, a program that assesses various features, attributes, and capabilities of a computer running Windows. Wmic The wmic command starts the Windows Management Instrumentation Command line (WMIC), a scripting interface that simplifies the use of Windows Management Instrumentation (WMI) and systems managed via WMI. Wsmanhttpconfig The wsmanhttpconfig command is used to manage aspects of the Windows Remote Management (WinRM) service. Xcopy The xcopy command can copy one or more files or directory trees from one location to another. The xcopy command is generally considered a more «powerful» version of the copy command though the robocopy command trumps even xcopy. A command by the name of xcopy32 existed in Windows 95 and Windows 98. To avoid a long and confusing explanation here, just know that no matter if you executed the xcopy command or the xcopy32 command, you were always executing the most updated version of the command. Xwizard The xwizard command, short for Extensible Wizard, is used to register data in Windows, often from a preconfigured XML file.

Содержание

  • Перечень основных команд
    • Запуск системных утилит
    • Работа с файлами и папками
    • Работа с текстовыми файлами
    • Работа с учетными записями
    • Работа с процессами
    • Работа в сети
    • Другие команды
  • Вопросы и ответы

Интерпретатор командной строки в Windows 7

В Windows 7 существуют такие операции, которые невозможно или затруднительно выполнить через обычный графический интерфейс, но их реально осуществить через интерфейс «Командной строки» при помощи интерпретатора CMD.EXE. Рассмотрим основные команды, которые могут применять пользователи при использовании указанного инструмента.

Читайте также:
Основные команды Linux в «Терминале»
Запуск «Командной строки» в Windows 7

Перечень основных команд

С помощью команд в «Командной строке» запускаются различные утилиты и выполняются определенные операции. Зачастую основное командное выражение используется вместе с рядом атрибутов, которые записываются через косую черту (/). Именно эти атрибуты инициируют выполнение конкретных операций.

Мы не ставим перед собой цель описать абсолютно все команды, применяемые при использовании инструмента CMD.EXE. Для этого пришлось бы написать не одну статью. Мы же постараемся уместить на одной странице информацию о наиболее полезных и популярных командных выражениях, разбив их на группы.

Запуск системных утилит

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

CHKDSK – запускает утилиту Check Disk, которая выполняет проверку жестких дисков компьютера на ошибки. Данное командное выражение можно вводить с дополнительными атрибутами, которые, в свою очередь, запускают выполнение определенных операций:

  • /f – восстановление диска в случае обнаружения логических ошибок;
  • /r – восстановление секторов накопителя в случае обнаружения физических повреждений;
  • /x – отключение указанного жесткого диска;
  • /scan – сканирование на упреждение;
  • C:, D:, E: … — указание логических дисков для сканирования;
  • /? – вызов справки о работе утилиты Check Disk.

Запуск утилиты Check Disk с атрибутами через интерфейс командной строки в Windows 7

SFC – запуск утилиты проверки целостности системных файлов Windows. Данное командное выражение чаще всего используется с атрибутом /scannow. Оно запускает инструмент, который проверяет файлы ОС на соответствие стандартам. В случае повреждений, при наличии установочного диска существует возможность восстановления целостности системных объектов.

Запуск утилиты sfc через интерфейс командной строки в Windows 7

Работа с файлами и папками

Следующая группа выражений предназначена для работы с файлами и папками.

APPEND – открытие файлов в указанной пользователем папке в том виде, как если бы они находились в требуемом каталоге. Обязательным условием является указание пути к папке, к которой будет применено действие. Запись производится по следующему шаблону:

append [;] [[диск компьютера:]путь[;...]]

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

  • /e – запись полного списка файлов;
  • /? – запуск справки.

Применение команды APPEND с атрибутами через интерфейс командной строки в Windows 7

Lumpics.ru

ATTRIB – команда предназначена для изменения атрибутов файлов или папок. Так же, как и в предыдущем случае, обязательным условием является ввод вместе с командным выражением полного пути к обрабатываемому объекту. Для установки атрибутов используются следующие ключи:

  • h – скрытый;
  • s – системный;
  • r – только для чтения;
  • a – архивный.

Для того чтобы применить или отключить атрибут, перед ключом соответственно ставится знак «+» или «-».

Применение команды ATTRIB через интерфейс командной строки в Windows 7

COPY – применяется для копирования файлов и каталогов из одной директории в другую. При использовании команды обязательно указание полного пути объекта копирования и папки, в которую оно будет производиться. С данным командным выражением можно использовать следующие атрибуты:

  • /v – проверка корректности копирования;
  • /z – копирование объектов из сети;
  • /y – перезапись конечного объекта при совпадении имен без подтверждения;
  • /? – активация справки.

Применение команды COPY с атрибутами через интерфейс командной строки в Windows 7

DEL – удаление файлов из указанной директории. Командное выражение предусматривает возможность использования ряда атрибутов:

  • /p – включение запроса подтверждения удаления перед манипуляцией с каждым объектом;
  • /q – отключение запроса при удалении;
  • /s – удаление объектов в каталогах и подкаталогах;
  • /a: — удаление объектов с указанными атрибутами, которые назначаются при помощи тех же ключей, что и при использовании команды ATTRIB.

Применение команды DEL с атрибутами через интерфейс командной строки в Windows 7

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

Применение команды RD с атрибутами через интерфейс командной строки в Windows 7

DIR – выводит список всех подкаталогов и файлов, которые расположены в указанной директории. Вместе с основным выражением применяются такие атрибуты:

  • /q – получение информации о владельце файла;
  • /s – отображение перечня файлов из указанного каталога;
  • /w – вывод списка в несколько колонок;
  • /o – сортировка перечня выводимых объектов (e – по расширению; n – по имени; d – по дате; s – по размеру);
  • /d – отображение списка в несколько колонок с сортировкой по этим колонкам;
  • /b – отображение исключительно имен файлов;
  • /a – отображение объектов с определенными атрибутами, для указания которых используются те же ключи, что и при использовании команды ATTRIB.

Применение команды DIR с атрибутами через интерфейс командной строки в Windows 7

REN – используется для переименования каталогов и файлов. В качестве аргументов к данной команде указывается путь к объекту и его новое название. Например, для переименования файла file.txt, который расположен в папке «Folder», находящейся в корневой директории диска D, в файл file2.txt, нужно ввести следующее выражение:

REN D:folderfile.txt file2.txt

Применение команды REN с атрибутами через интерфейс командной строки в Windows 7

MD – предназначена для создания новой папки. В синтаксисе команды обязательно следует указать диск, на котором будет располагаться новый каталог, и директорию его размещения в том случае, если он является вложенным. Например, для создания каталога folderN, который расположен в директории folder на диске E, следует ввести такое выражение:

md E:folderfolderN

Применение команды MD через интерфейс командной строки в Windows 7

Работа с текстовыми файлами

Следующий блок команд предназначен для работы с текстом.

TYPE – отображает на экране содержимое текстовых файлов. Обязательными аргументом данной команды является полный путь к объекту, текст в котором следует просмотреть. Например, для просмотра содержимого файла file.txt, находящегося в папке «Folder» на диске D, требуется ввести следующее командное выражение:

TYPE D:folderfile.txt

Применение команды TYPE через интерфейс командной строки в Windows 7

PRINT – распечатка содержимого текстового файла. Синтаксис данной команды аналогичен предыдущему, но вместо вывода текста на экран производится его распечатка.

Применение команды PRINT через интерфейс командной строки в Windows 7

FIND – производит поиск текстовой строки в файлах. Вместе с этой командой обязательно указывается путь к объекту, в котором выполняется поиск, а также название искомой строки, заключенное в кавычки. Кроме того, вместе с данным выражением применяются следующие атрибуты:

  • /c – выводится общее количество строк, содержащих искомое выражение;
  • /v – вывод строк, которые не содержат искомое выражение;
  • /I – поиск без учета регистра.

Применение команды FIND с атрибутами через интерфейс командной строки в Windows 7

Работа с учетными записями

С помощью командной строки можно просматривать информацию о пользователях системы и управлять ими.

FINGER – отображение информации о зарегистрированных в операционной системе пользователях. Обязательным аргументом данной команды является имя юзера, о котором требуется получить данные. Кроме того, можно использовать атрибут /i. В этом случае вывод информации будет производиться в списочном варианте.

Применение команды FINGER с атрибутами через интерфейс командной строки в Windows 7

TSCON – выполняет присоединение сеанса пользователя к сеансу терминала. При использовании данной команды обязательно требуется указать ID сеанса или его имя, а также пароль того юзера, которому он принадлежит. Пароль следует указывать после атрибута /PASSWORD.

Применение команды TSON с атрибутами через интерфейс командной строки в Windows 7

Работа с процессами

Следующий блок команд предназначен для управления процессами на компьютере.

QPROCESS – предоставление данных о запущенных процессах на ПК. Среди выводимой информации будет представлено наименование процесса, имя пользователя, его запустившего, название сеанса, ID и PID.

Применение команды QPROCESS через интерфейс командной строки в Windows 7

TASKKILL – используется для завершения процессов. Обязательным аргументом является наименование элемента, который нужно остановить. Он указывается после атрибута /IM. Также можно произвести завершение не по имени, а по идентификатору процесса. В этом случае используется атрибут /PID.

Применение команды TASKKILL с атрибутами через интерфейс командной строки в Windows 7

Работа в сети

С помощью командной строки существует возможность управлять различными действиями в сети.

GETMAC – запускает отображение MAC-адреса подключенной к компьютеру сетевой карты. В случае наличия нескольких адаптеров отображаются все их адреса.

Применение команды GETMAC через интерфейс командной строки в Windows 7

NETSH – инициирует запуск одноименной утилиты, с помощью которой производится демонстрация информации о параметрах сети и их изменение. Данная команда, ввиду своей очень широкой функциональности, имеет огромное количество атрибутов, каждый из которых отвечает за выполнение определенной задачи. Для получения подробной информации о них можно воспользоваться справкой, применив следующее командное выражение:

netsh /?

Запуск справки для команды netsh через интерфейс командной строки в Windows 7

NETSTAT – отображение статистической информации о сетевых подключениях.

Применение команды NETSTAT через интерфейс командной строки в Windows 7

Другие команды

Также существует ряд других командных выражений, применяемых при использовании CMD.EXE, которые нельзя выделить в отдельные группы.

TIME – просмотр и установка системного времени ПК. При вводе данного командного выражения происходит вывод на экран текущего времени, которое в самой нижней строке можно изменить на любое другое.

Применение команды TIME через интерфейс командной строки в Windows 7

DATE – команда по синтаксису полностью аналогична предыдущей, но применяется не для вывода и изменения времени, а для запуска данных процедур в отношении даты.

Применение команды DATE через интерфейс командной строки в Windows 7

SHUTDOWN – выключает компьютер. Данное выражение можно использовать, как локально, так и удаленно.

Применение команды SHUTDOWN через интерфейс командной строки в Windows 7

BREAK – отключение или запуск режима обработки сочетания кнопок Ctrl+C.

Применение команды BREAK через интерфейс командной строки в Windows 7

ECHO – выводит текстовые сообщения и применяется для переключения режимов их отображения.

Применение команды ECHO через интерфейс командной строки в Windows 7

Это далеко не полный список всех команд, которые применяются при использовании интерфейса CMD.EXE. Тем не менее мы попытались раскрыть наименования, а также вкратце описать синтаксис и основные функции самых востребованных из них, для удобства разбив на группы по назначению.

This section provides an overview of what cmd is, and why a developer might want to use it.

It should also mention any large subjects within cmd, and link out to the related topics. Since the Documentation for cmd is new, you may need to create initial versions of those related topics.

Opening a Command Prompt

The command prompt comes pre-installed on all Windows NT, Windows CE, OS/2 and eComStation operating systems, and exists as cmd.exe, typically located in C:Windowssystem32cmd.exe

On Windows 7 the fastest ways to open the command prompt are:

  • Press enter image description here, type «cmd» and then press Enter.

  • Press enter image description here+R, type «cmd» then then press Enter.

It can also be opened by navigating to the executable and double-clicking on it.

In some cases you might need to run cmd with elevated permissions, in this case right click and select «Run as administrator». This can also be achieved by pressing Control+ Shift+Enter instead of Enter.

Navigating in cmd

One of the most common things you’ll need to do in the command prompt is navigate your file system. To do this, we’ll utilize the cd and dir keywords. Start by opening up a command prompt using one of the methods mentioned here. You most likely see something similar to what’s below, where UserName is your user.

C:UsersUserName>

Regardless of where in your file structure you are, if your system is like most, we can start with this command:

cd C:

This will change your current directory to the C: drive. Notice how the screen now looks like this

C:>

Next, run a dir so we can see anything in the C: drive

dir

This will show you a list of files and folders with some information about them, similar to this:

dir command

There’s lots of good info here, but for basic navigation, we just care about the right-most column. Notice how we have a Users folder. That means we can run this

cd Users

Now if you run dir again, you’ll see all the files and folders in your C:Users directory. Now, we didn’t find what we wanted here, so let’s go back to the parent folder. Rather than type the path to it, we can use .. to go up one folder like so

cd ..

Now we are back in C:. If you want to go up multiple folders at once, you can put a backslash and another set of periods like so: cd ...., but we only needed one folder.

Now we want to look in that Program Files folder. To avoid confusing the system, it’s a good idea to put quotes around the directories, especially when there are spaces in the name. So this time, we’ll use this command

C:>cd "Program Files"

Now you are in C:Program Files> and a dir command now will tell you anything that’s in here.

So, say we get tired of wandering around to find the folder and looked up exactly where we were needing to go. Turns out it’s C:WindowsLogs Rather than do a .. to Windows to Logs, we can just put the full path like so:

cd "C:WindowsLogs"

And that’s the basics of navigating the command prompt. You can now move through all your folders so you can run your other commands in the proper places.

Commands in CMD

The available commands will be displayed, including a brief description, in tabular format.
In Windows 10 the following commands are listed:

Command Description
ASSOC Displays or modifies file extension associations.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
BCDEDIT Sets properties in boot database to control boot loading.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKPART Displays or configures Disk Partition properties.
DOSKEY Edits command lines, recalls Windows commands, and
creates macros.
DRIVERQUERY Displays current device driver status and properties.
ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the CMD.EXE program (command interpreter).
FC Compares two files or sets of files, and displays the
differences between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows.
FSUTIL Displays or configures the file system properties.
FTYPE Displays or modifies file types used in file extension
associations.
GOTO Directs the Windows command interpreter to a labeled line in
a batch program.
GPRESULT Displays Group Policy information for machine or user.
GRAFTABL Enables Windows to display an extended character set in
graphics mode.
HELP Provides Help information for Windows commands.
ICACLS Display, modify, backup, or restore ACLs for files and
directories.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
MKDIR Creates a directory.
MKLINK Creates Symbolic Links and Hard Links
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another
directory.
OPENFILES Displays files opened by remote users for a file share.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by
PUSHD.
PRINT Prints a text file.
PROMPT Changes the Windows command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
RECOVER Recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RMDIR Removes a directory.
ROBOCOPY Advanced utility to copy files and directory trees
SET Displays, sets, or removes Windows environment variables.
SETLOCAL Begins localization of environment changes in a batch file.
SC Displays or configures services (background processes).
SCHTASKS Schedules commands and programs to run on a computer.
SHIFT Shifts the position of replaceable parameters in batch files.
SHUTDOWN Allows proper local or remote shutdown of machine.
SORT Sorts input.
START Starts a separate window to run a specified program or command.
SUBST Associates a path with a drive letter.
SYSTEMINFO Displays machine specific properties and configuration.
TASKLIST Displays all currently running tasks including services.
TASKKILL Kill or stop a running process or application.
TIME Displays or sets the system time.
TITLE Sets the window title for a CMD.EXE session.
TREE Graphically displays the directory structure of a drive or
path.
TYPE Displays the contents of a text file.
VER Displays the Windows version.
VERIFY Tells Windows whether to verify that your files are written
correctly to a disk.
VOL Displays a disk volume label and serial number.
XCOPY Copies files and directory trees.
WMIC Displays WMI information inside interactive command shell.

To get more insight about a specific command use the /? option, e.g. the tree command gives:

tree /?

Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]
 
   /F   Display the names of the files in each folder.
   /A   Use ASCII instead of extended characters.

Features

Microsoft Command Prompt is a command-line interpreter (CLI) for the Windows operating systems.

A CLI is program intended primarily to read operating system instructions typed on a keyboard by the user.
It is therefore addressed also as a command-line interface, to contrast it with graphical interfaces.

As these interfaces (whether textual or graphical) shield the user from directly accessing to the operating system kernel, they are also said shells.

Given the name of the Command Prompt executable file, cmd.exe, the Command Prompt is friendly named cmd.
Given its OS piloting role, it is also said the console.

Like other shells, cmd can read batch of instructions from a file. In this case the cmd shell acts as a language interpreter and the file content can be regarded as an actual program. When executing these batch programs, there is no intermediate compilation phase. They are typically read, interpreted and executed line by line. Since there is no compilation, there is no production of a separated executable file. For this reason the programs are denoted batch scripts or shell scripts.

Note that the instructions entered interactively might have a slightly different syntax from those submitted as a script, but the general principle is that what can be entered from the command line can be also put in a file for later reuse.

Hello World

Command Prompt batch scripts have extension .cmd or .bat, the latter for compatibility reasons.

To create a hello-word-script, you first need a place where to type it.
For simple scripts, also the Windows Notepad will do. If you are serious about shell scripting, you need more effective tools. There are anyway several free alternatives, such as Notepad++.

In your designated editor type:

echo Hello World
pause

Save it as hello.cmd

If you are using «Notepad» as an editor, you should pay much attention to the saved name, as Notepad tends to add always a .txt extension to your files, which means that the actual name of your file might be hello.cmd.txt. To avoid this, in the save dialog box:

  1. In the File name field enter the name in double quotes, e.g. "hello.cmd"
  2. In the Save as type field select All Files, instead of the default Text Document option.

If the file has been saved properly, its icon should be similar to (Windows Vista):

cmd icon

You may also consider to disable the option «Hide extension for known file types» in File Explorer folder view options. In this case, file names are always displayed with their extensions.

To execute hello.cmd there are two possibilities. If you are using the Windows graphical shell, just double click on its icon.

If you want to use the Command Prompt itself, you must first identify the directory where you saved hello.cmd.
In this regard, if you open File Explorer with +E. In the windows listing files, you normally read the name of the directory path containing them. You can therefore identify the directory of hello.cmd. Windows directory names tend to be quite long and typing them is error prone. It is better if you select and copy the directory path in the clipboard for later pasting.

Start the Command Prompt. You read a line similar to this.

Microsoft Windows [Version ...]
(c) ... Microsoft Corporation. All rights reserved.
 
C:Users...>

The version/year of Windows of course depends on yours.
In the the final line, before >, you read the path of the directory which is current. You should make current the directory where your script is. For this reason enter the change directory command cd, using a line similar to the following:

cd <dirpath>

Instead of <dirpath>, paste the name of the directory you previously copied.
To paste the directory path, in Windows 10, you just need to type CtrlC, as you would in an editor.
For older systems you should be able to do this by right clicking in the cmd window.
After entering the command, note that current path, before >, changes accordingly.

You can now run your hello script by simply entering:

hello

Comments

The script prints an output similar to:

C:Users...>echo Hello World
Hello World

C:Users...>pause
Press any key to continue . . .

The lines hosting the symbol > restate the script instructions as if you had entered interactively.
This can be disabled writing:

@echo off

as the first line of your script.
This might reduce the clutter, but you have less hints on what is going on, with respect to those script commands that do not give visible outputs.

The last command, pause, prompts you to hit any key. When you do, you exit hello.
If you run hello from the console, you don’t really need it, because, when hello terminates its execution, cmd.exe remains open and you can to read hello output.
When double-clicking in Explorer, you start cmd.exe for the time necessary to execute hello. When hello terminates, cmd.exe does the same and you have no possibility to read hello output.
pause command prevents hellofrom exiting until you hit a key, which gives also the possibility to read the output.

Finally, despite the name of the script is hello.cmd, it is not necessary to type the whole name, its hello stem is sufficient. This mechanism works for executables too, with extension .exe. What if there is a script hello.cmd and an executable hello.exe in the same directory? The former has priority in the Command Prompt, so hello.cmd will be executed.


Download Article

A painless guide to accessing the Windows command prompt


Download Article

This wikiHow teaches you how to open the Command Prompt program in Windows. There are several ways to do this, from simply searching in the Start menu to using a Run command. Keep in mind that some computers, such as school computers, will not be able to run Command Prompt due to restrictions.

  1. Image titled Open the Command Prompt in Windows Step 1

    1

    Open Start

    Image titled Windowsstart.png

    . Click the Windows logo in the bottom-left corner of the screen, or press the Win key. You can search for Command Prompt on all supported versions of Windows.

    • If you’re using Windows 8, instead place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
  2. Image titled Open the Command Prompt in Windows Step 2

    2

    Type command prompt into Start. The Start search bar is at the bottom of the Start window. Searching for Command Prompt here will look for Command Prompt.

    Advertisement

  3. Image titled Open the Command Prompt in Windows Step 3

    3

    Click

    Image titled Windowscmd1.png

    Command Prompt. You should see the Command Prompt icon appear near the top of the Start window. Clicking its icon will open Command Prompt.

  4. Advertisement

  1. Image titled Open the Command Prompt in Windows Step 4

    1

    Open the Run program. Hold the Win key and press the R key to open the Run window.

    • You can also right-click the Start icon (or press Win+X) and then click Run to do this.
  2. Image titled Open the Command Prompt in Windows Step 5

    2

    Type cmd into Run. This is the command to open Command Prompt.

  3. Image titled Open the Command Prompt in Windows Step 6

    3

    Click OK. Doing so runs the «cmd.exe» command, which opens Command Prompt.

  4. Advertisement

  1. Image titled Open the Command Prompt in Windows Step 7

    1

    Open Start

    Image titled Windowsstart.png

    . Click the Windows logo in the bottom-left corner of the screen. You can also press the Win key.

  2. Image titled Open the Command Prompt in Windows Step 8

    2

    Scroll down to Windows System and click it. This folder will be near the bottom of the Start window.

  3. Image titled Open the Command Prompt in Windows Step 9

    3

    Click

    Image titled Windowscmd1.png

    Command Prompt. It should be near the top of the Windows System folder. Doing so will open Command Prompt.

  4. Advertisement

Add New Question

  • Question

    How do I close out Command Prompt?

    ClixTech Australia

    ClixTech Australia

    Community Answer

    Type «exit» in the Command Prompt, or press the red «X» in the top right corner, or press Alt+F4 on the keyboard. Check out the Close Command Prompt article for more detailed instructions!

  • Question

    What do I do if I can’t use Microsoft Edge and the Start button?

    Community Answer

    Press the Windows Key + R, then type in cmd.exe and hit enter.

  • Question

    How do I stop Windows command prompt from starting up automatically?

    Community Answer

    If it starts up every time, then something is causing it. It may be a program or a shortcut to command prompt that is saved in your Windows start folder. If you want to stop it from appearing altogether by uninstalling it, you won’t be able to.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Video

  • Command Prompt is a good place to run legacy or specialty software. You might also use it if you’re trying to manipulate specific files.[1]

  • To run Command Prompt in administrator mode, right-click the Command Prompt icon and click Run as administrator.

Advertisement

  • If you’re using a computer with restricted access to settings and programs, you may not be able to open Command Prompt.

Advertisement

About This Article

Article SummaryX

1. Open Start.
2. Type in command prompt.
3. Click Command Prompt at the top.

Did this summary help you?

Thanks to all authors for creating a page that has been read 581,301 times.

Is this article up to date?

Содержание

  • 1 Немного теории и фактов
  • 2 Зачем обычному пользователю командная строка
  • 3 Как открыть командную строку в Windows 7
  • 4 Как пользоваться командной строкой
  • 5 Видео по теме

Самые ранние операционные системы не имели привычного для современного пользователя графического интерфейса. Ранее для управления компьютером использовались исключительно текстовые команды.

Однако и сегодня, несмотря на разнообразие возможностей, обеспечивающих лёгкое и удобное общение пользователя с ПК, они всё ещё используются. Существуют и такие ОС, которые работают только при помощи ввода в них текстовых команд. Их обычно используют администраторы баз данных, программисты и другие IT-специалисты.

Отличный пример управления операционной системой при помощи текстовых команд — командная строка Windows 7. Она присутствует в любом дистрибутиве этой ОС и её можно запустить на любом ПК под управлением этой операционной системы. Вам не нужно быть администратором или каким-либо IT-специалистом, чтобы научиться ею пользоваться. Давайте, рассмотрим этот вопрос подробней.

Немного теории и фактов

Командная строка Windows представляет собой инструментарий, позволяющий пользователю осуществлять различные действия над операционной системой либо над отдельными программами путём ввода текстовых команд. Командная строка состоит, как правило, из интерпретатора команд (оболочки) и текстового интерфейса. Первый отвечает за передачу и выполнение команд операционной системой, второй — обеспечивает пользователя возможностью ввода этих самых команд и просмотра результата их выполнения.

Окно командной строки

Командная строка предлагает большие возможности для управления операционной системой. Практически всё, что можно настроить в Windows при помощи мышки, можно сделать и через неё. Отсюда следует вывод — командная строка способна выполнить достаточно большой список задач, каждая из которых выполняется посредством поочерёдного ввода уникальной команды. Именно из-за необходимости запоминания синтаксиса этих команд и умения ими пользоваться большинство рядовых пользователей имеют затруднения в работе с командной строкой.

Даже несмотря на это, использование командной строки не такая уж и сложная задача. Здесь главное научиться понимать сам принцип её работы, о чём и будет подробнее сказано далее.

Зачем обычному пользователю командная строка

Наверняка, каждый из вас сталкивался с различными статьями в Интернете, в которых авторы призывают воспользоваться той или иной командой для решения определённой задачи. К примеру, через командную строку можно осуществлять управление файлами, хранящимися на любом носителей, изменять параметры работы системы или даже создавать подключение к Интернету. Однако перечисленное выше можно с легкостью выполнить и с помощью привычной мыши и клавиатуры.

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

Вот несколько примеров:

  • Регистрация в системе динамических DLL-библиотек (зачастую необходимо проделывать при копировании в системную папку Windows нового DLL-файла — регистрация «даст понять» системе, что появилась новая библиотека);
  • Настройка сетевого адаптера компьютера в качестве беспроводной точки доступа Wi-Fi;
  • Можно даже выйти в Интернет, произведя соединение с сетью через одно из существующих подключений.

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

При помощи командной строки не только можно выполнить запуск приложения, но и зайти в любую папку с целью работы над какими-либо файлами (копирование, перемещение, задание нового имени и так далее). И это лишь часть возможностей командной строки. Давайте теперь перейдём к практике.

Как открыть командную строку в Windows 7

Первое, что необходимо сделать — выполнить запуск командной строки и лучше от имени администратора.

Запускается она одним из следующих способов:

Выполнив одно из вышеприведённых действий, вы осуществите вызов командной строки — обычно это небольшое окно чёрного цвета.

Для чего нужны права администратора? Дело в том, что существует ряд команд, которые способны изменять системные настройки. Вызвать выполнение таких команд можно только с правами администратора. Сделано это для безопасности. Поэтому, если вы находитесь в учётной записи гостя, у вас не получится осуществить вызов командной строки от имени администратора, а значит и выполнять команды, связанные с системными настройками.

Как пользоваться командной строкой

По причине того, что команд достаточно большое количество, весь их список невозможно отобразить в рамках одной статьи. По этой причине мы рассмотрим наиболее простые команды, которые можно выполнять и без прав администратора. Начнём.

После запуска командной строки вы увидите примерно такое окно:

Командная строка

Адресная строка, предшествующая мигающему курсору — это адрес текущей папки на жёстком диске (или на любом другом подключенном устройстве). Переход по папкам (смена текущей папки) — одно из самых простых действий. Давайте, выполним эту команду. Для этого в окно необходимо вписать команду cd и указать полный путь до имени нужной нам папки, а затем нажать Enter для запуска выполнения. Например, если требуется попасть по адресу «C:Program Files», для этого достаточно ввести cd C:”Program Files”

Важно! При переходе к папке с пробелом в имени, её необходимо указывать в кавычках.

Смена текущей директории

Таким образом, можно попасть в любую директорию жёсткого диска. Также необходимо знать, что если папка расположена в текущей папке командной строки, то при помощи «cd» она открывается без необходимости указания полного пути (достаточно после команды указать имя папки).

Чтобы выйти из текущей папки в папку более высокого уровня, то есть родительскую, используйте команду cd .. (две точки означают родительский каталог).

Переход к родительской папке

Теперь выполним переход на другой локальный диск. Для этого достаточно указать буквы диска с двоеточием. Например, мы хотим попасть на диск «D:» — пишем команду d: а затем нажимаем Enter.

Смена диска

Просмотр содержимого папки осуществляется при помощи команды «dir». Введите её и командная строка покажет список содержимого диска «D:». Команду «dir» можно вызывать из любой папки — даже для просмотра содержимого каталога на другом диске (для этого необходимо ввести полный путь до имени нужной папки). Например, выполните: dir c:windows

Просмотр содержимого папки

Рассмотрим ещё одну команду — «copy». Как ясно из названия, она служит для копирования данных. Например, вы находитесь на диске «D:» и вам нужно скопировать файл «1.txt» на флешку. Для этого вводим copy 1.txt F: Вместо «F:» можно указать любую другую букву диска (в нашем случае копируем на диск «C:») или полный путь до того каталога, куда необходимо скопировать файлы или папки.

Копирование файла

Более продвинутая версия команды копирования — команда «robocopy», в отличие от своей предшественницы, она умеет копировать не только файлы, но и папки, включая их содержимое.

Вам не обязательно запоминать названия всех команд. Для вывода полного перечня с кратким описанием наберите: help

Для получения подробнейшей информации, к примеру, для robocopy, наберите: help robocopy

Обратите внимание, что help отображает все описания на русском языке, конечно же, если версия Windows у вас русифицированная.

Всё, что рассмотрено здесь — лишь малая часть возможностей командной строки. Если у вас есть интерес к её использованию, рекомендуем посетить официальный сайт Microsoft, где имеется полная информация по работе с ней.

Видео по теме

Понравилась статья? Поделить с друзьями:
  • Using windows 7 for its final days
  • Using volume id harddiskvolume2 windows loader
  • Using system windows forms не работает
  • Using system windows forms как подключить
  • Using modal windows is not allowed in this mode 1c