Windows start run command line

Start or stop Windows service from command line (CMD)

We normally use Services.msc to start or stop or disable or enable any service. We can do the same from windows command line also using net and sc utilities. Below are commands for controlling the operation of a service.

Command to stop a service:

To start a service:

You need to have administrator privileges to run net start/stop commands. If you are just a normal user on the computer, you would get an error like below.

To disable a service:

To enable a service:

To make a service start automatically with system boot:

Note: Space is mandatory after ‘=’ in the above sc commands.

This SC command works on a Windows 7 machine and also on the down-level editions of Windows i.e Windows XP/2003 and Windows Vista. Again, if you do not have administrator previliges you would get the below error.

Note that the service name is not the display name of a service. Each service is given a unique identification name which can be used with net or sc commands. For example, Remote procedure call (RPC) is the display name of the service. But the service name we need to use in the above commands is RpcSs.
So to start Remote procedure call service the command is:

These service names are listed below for each service. The first column shows the display name of a service and the second column shows the service name that should be used in net start or net stop or sc config commands.

start

Starts a separate Command Prompt window to run a specified program or command.

Syntax

Parameters

Parameter Description
Specifies the title to display in the Command Prompt window title bar.
/d

Specifies the startup directory. /i Passes the Cmd.exe startup environment to the new Command Prompt window. If /i is not specified, the current environment is used. Specifies to minimize (/min) or maximize (/max) the new Command Prompt window. Starts 16-bit programs in a separate memory space (/separate) or shared memory space (/shared). These options are not supported on 64-bit platforms. Starts an application in the specified priority class. /affinity Applies the specified processor affinity mask (expressed as a hexadecimal number) to the new application. /wait Starts an application and waits for it to end. /elevate Runs application as administrator. /b Starts an application without opening a new Command Prompt window. CTRL+C handling is ignored unless the application enables CTRL+C processing. Use CTRL+BREAK to interrupt the application. [ [

. ]] Specifies the command or program to start.

Specifies parameters to pass to either the command or the program. /? Displays help at the command prompt.

Remarks

You can run non-executable files through their file association by typing the name of the file as a command.

If you run a command that contains the string CMD as the first token without an extension or path qualifier, CMD is replaced with the value of the COMSPEC variable. This prevents users from picking up cmd from the current directory.

If you run a 32-bit graphical user interface (GUI) application, cmd does not wait for the application to quit before returning to the command prompt. This behavior does not occur if you run the application from a command script.

If you run a command that uses a first token that does not contain an extension, Cmd.exe uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. The default value for the PATHEXT variable is:

Note that the syntax is the same as the PATH variable, with semicolons (;) separating each extension.

When searching for an executable file, if there is no match on any extension, start checks to see if the name matches a directory name. If it does, start opens Explorer.exe on that path.

Examples

To start the Myapp program at the command prompt and retain use of the current Command Prompt window, type:

To view the start command-line help topic in a separate maximized Command Prompt window, type:

start start

Запускает отдельное окно командной строки для запуска указанной программы или команды. Starts a separate Command Prompt window to run a specified program or command.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
Задает заголовок, отображаемый в строке заголовка окна командной строки . Specifies the title to display in the Command Prompt window title bar.
/d

Указывает каталог запуска. Specifies the startup directory. /i /i Передает Cmd.exe среду запуска в новое окно командной строки . Passes the Cmd.exe startup environment to the new Command Prompt window. Если параметр /i не указан, используется текущая среда. If /i is not specified, the current environment is used. Служит для сворачивания (/min) или развертывания (/Макс) нового окна командной строки . Specifies to minimize (/min) or maximize (/max) the new Command Prompt window. Запускает 16-разрядные программы в отдельном пространстве памяти (/сепарате) или общей памяти (/Shared). Starts 16-bit programs in a separate memory space (/separate) or shared memory space (/shared). Эти параметры не поддерживаются на 64-разрядных платформах. These options are not supported on 64-bit platforms. Запускает приложение в указанном классе приоритета. Starts an application in the specified priority class. /аффинити /affinity Применяет указанную маску схожести процессоров (выраженную в виде шестнадцатеричного числа) к новому приложению. Applies the specified processor affinity mask (expressed as a hexadecimal number) to the new application. /Wait /wait Запускает приложение и ждет его завершения. Starts an application and waits for it to end. /елевате /elevate Запускает приложение от имени администратора. Runs application as administrator. /b /b Запускает приложение, не открывая новое окно командной строки . Starts an application without opening a new Command Prompt window. Обработка CTRL + C игнорируется, если приложение не поддерживает обработку CTRL + C. CTRL+C handling is ignored unless the application enables CTRL+C processing. Чтобы прервать работу приложения, используйте сочетание клавиш CTRL + BREAK. Use CTRL+BREAK to interrupt the application. [ [

. ]] Указывает запускаемую команду или программу. Specifies the command or program to start.

Указывает параметры для передачи в команду или программу. Specifies parameters to pass to either the command or the program. /? /? Отображение справки в командной строке. Displays help at the command prompt.

Комментарии Remarks

Вы можете запускать неисполняемые файлы с помощью сопоставления файлов, вводя имя файла в виде команды. You can run non-executable files through their file association by typing the name of the file as a command.

При выполнении команды, содержащей строку CMD в качестве первого маркера без квалификатора расширения или пути, команда CMD заменяется значением переменной COMSPEC. If you run a command that contains the string CMD as the first token without an extension or path qualifier, CMD is replaced with the value of the COMSPEC variable. Это не позволяет пользователям выбирать cmd из текущего каталога. This prevents users from picking up cmd from the current directory.

Если вы запускаете приложение с 32-битным графическим пользовательским интерфейсом (GUI), программа cmd не ждет завершения работы приложения, прежде чем вернуться в командную строку. If you run a 32-bit graphical user interface (GUI) application, cmd does not wait for the application to quit before returning to the command prompt. Такое поведение не происходит при запуске приложения из командного скрипта. This behavior does not occur if you run the application from a command script.

При выполнении команды, использующей первый токен, который не содержит расширение, Cmd.exe использует значение переменной среды ПАСЕКСТ, чтобы определить, какие расширения следует искать и в каком порядке. If you run a command that uses a first token that does not contain an extension, Cmd.exe uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. Значение по умолчанию для переменной ПАСЕКСТ: The default value for the PATHEXT variable is:

Обратите внимание, что синтаксис аналогичен переменной PATH с точкой с запятой (;) Отделение каждого расширения. Note that the syntax is the same as the PATH variable, with semicolons (;) separating each extension.

При поиске исполняемого файла, если нет совпадения с каким-либо расширением, запустите проверку, чтобы проверить, совпадает ли имя с именем каталога. When searching for an executable file, if there is no match on any extension, start checks to see if the name matches a directory name. Если это так, то Start открывает Explorer.exe по этому пути. If it does, start opens Explorer.exe on that path.

Примеры Examples

Чтобы запустить программу MyApp из командной строки и использовать текущее окно командной строки , введите: To start the Myapp program at the command prompt and retain use of the current Command Prompt window, type:

Чтобы просмотреть раздел справки по командной строке в отдельном окне командной строки с развернутым окном, введите: To view the start command-line help topic in a separate maximized Command Prompt window, type:

Windows Start | Run commands

Description Run Command
Accessibility Options utilman
or
control access.cpl
Add Hardware Wizard hdwwiz
Programs and Features
(Add New Programs)
(Add Remove Windows Components)
(Set Program Access & Defaults )
appwiz.cpl
control appwiz.cpl,,1
control appwiz.cpl,,2
control appwiz.cpl,,3
Administrative Tools control admintools
Advanced User Accounts Control Panel netplwiz
Authorization Manager azman.msc
Automatic Update control wuaucpl.cpl
Backup and Restore Utility sdclt
Bluetooth Transfer Wizard fsquirt
Calculator calc
Certificate Manager certmgr.msc
Character Map charmap
Check Disk Utility chkdsk
Clear Type (tune or turn off) cttune
Color Management colorcpl.exe
Command Prompt cmd
Component Services dcomcnfg
or
comexp.msc
Computer Management CompMgmtLauncher.exe
or
compmgmt.msc
Control Panel control
Credential (passwords) Backup and Restore Wizard credwiz
Data Execution Prevention SystemPropertiesDataExecutionPrevention
Date and Time Properties timedate.cpl
Device Manager hdwwiz
or
devmgmt.msc
Device Pairing Wizard DevicePairingWizard
Digitizer Calibration Tool (Tablets/Touch screens) tabcal
Direct X Control Panel (if installed) directx.cpl
Direct X Troubleshooter dxdiag
Disk Cleanup Utility cleanmgr
Disk Defragmenter dfrgui
defrag
Disk Management diskmgmt.msc
Disk Partition Manager diskpart
Display Color Calibration dccw
Display DPI / Text size dpiscaling
Display Properties (Themes, Desktop, Screensaver) control desktop
Display Properties (Resolution, Orientation) desk.cpl
Display Properties (Color & Appearance) control color
Documents (open ‘My Documents’ folder) documents
Downloads (open ‘Downloads’ folder) downloads
Driver Verifier Utility verifier
DVD Player dvdplay
Edit Environment Variables rundll32.exe sysdm.cpl,EditEnvironmentVariables
Encrypting File System Wizard (EFS) rekeywiz
Event Viewer eventvwr.msc
File Signature Verification Tool (Device drivers) sigverif
Files and Settings Transfer Tool %systemroot%\system32\migwiz\migwiz.exe
Firewall Control Panel firewall.cpl
Folders Properties control folders
Fonts list control fonts
Font preview fontview arial.ttf
Game Controllers joy.cpl
Local Group Policy Editor gpedit.msc
Internet Properties inetcpl.cpl
IP Configuration ipconfig
iSCSI Initiator configuration iscsicpl
Keyboard Properties control keyboard
Language Pack Installer lpksetup
Local Security Policy secpol.msc
Local Users and Groups lusrmgr.msc
Log out logoff
Microsoft Malicious Software Removal Tool mrt
Microsoft Management Console mmc
Access (Microsoft Office) msaccess
Excel (Microsoft Office) Excel
Powerpoint (Microsoft Office) powerpnt
Word (Microsoft Office) winword
Microsoft Paint mspaint
Microsoft Support Diagnostic Tool msdt
Mouse Properties control mouse
or
main.cpl
Network Connections control netconnections
or
ncpa.cpl
Projector:
Connect to Network Projector
Switch projector display
netproj

displayswitch Notepad notepad ODBC Data Source Admin
Default ODBC driver:
32-bit ODBC driver under 64-bit platform: C:\windows\system32\odbcad32.exe
C:\windows\sysWOW64\odbcad32.exe ODBC configuration — Install/configure MDAC drivers odbcconf On Screen Keyboard osk OOB Getting Started gettingstarted Password — Create a Windows Password Reset Disk (USB) «C:\Windows\system32\rundll32.exe» keymgr.dll,PRShowSaveWizardExW Pen and Touch (Tablet/Pen input configuration) tabletpc.cpl Performance Monitor perfmon.msc Phone and Modem Options telephon.cpl Phone Dialer dialer Power Configuration powercfg.cpl and powercfg.exe Presentation Settings PresentationSettings Problem Steps Recorder psr Program Access and Computer Defaults — browser / email / media computerdefaults Printers and Faxes control printers Print Management (.msc) PrintManagement Printer Migration (backup/restore) printbrmui and printbrm.exe Printer user interface (List all printui.dll options) printui Private Character Editor eudcedit Regional Settings — Language, Date/Time format, keyboard locale. intl.cpl Registry Editor regedit Remote Assistance msra Remote Desktop mstsc Resource Monitor resmon Resultant Set of Policy rsop.msc Settings (Windows 10) ms-settings: Scheduled Tasks control schedtasks Screenshot Snipping Tool snippingtool Security Center wscui.cpl Services services.msc Shared Folder Wizard shrpubw Shared Folders fsmgmt.msc Shut Down Windows shutdown Software Licensing/Activation slui Sounds and Audio mmsys.cpl Sound Recorder soundrecorder Sound Volume sndvol Syncronization Tool (Offline files) mobsync System Configuration Utility msconfig System File Checker Utility (Scan/Purge) sfc System Information msinfo32 System Properties

sysdm.cpl SystemProperties
or
sysdm.cpl DisplaySYSDMCPL

System Properties — Performance SystemPropertiesPerformance System Properties — Hardware SystemPropertiesHardware System Properties — Advanced SystemPropertiesAdvanced System Repair — Create a System Repair Disc recdisc System Restore rstrui Task Manager taskmgr Task Scheduler taskschd.msc Telnet Client telnet Trusted Platform Module Initialization Wizard tpmInit User Accounts (Autologon) control userpasswords2 User Account Control (UAC) Settings UserAccountControlSettings User Profiles — Edit/Change type C:\Windows\System32\rundll32.exe sysdm.cpl,EditUserProfiles Windows Disc Image Burning Tool isoburn C:\movies\madmax.iso Windows Explorer explorer.exe
explorer.exe . Will open at the current directory Windows Features optionalfeatures Windows Firewall
Windows Firewall with Advanced Security firewall.cpl
wf.msc Windows Image Acquisition (scanner) wiaacmgr Windows Magnifier magnify Windows Management Infrastructure wmimgmt.msc Windows Memory Diagnostic Scheduler mdsched Windows Mobility Center (Mobile PCs only) mblctr Windows PowerShell powershell Windows PowerShell ISE powershell_ise Windows Security Action Center wscui.cpl Windows Script Host(VBScript) wscript NAME_OF_SCRIPT.VBS Windows System Security Tool. Encrypt the SAM database.
(boot password.) syskey Windows Update wuapp Windows Update Standalone Installer wusa Windows Version (About Windows) winver WordPad write

Unless indicated otherwise, all the commands above work in all versions of Windows from Vista upwards.
Most of these utilities can be found in %systemroot%\System32\

“The Macintosh uses an experimental pointing device called a ‘mouse.’ There is no evidence that people want to use these things”

Читайте также:  Как передать файлы по bluetooth windows 10
Оцените статью