MS-DOS and Windows command line start command

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 and utilities. Below are commands for controlling the operation of a service.

Command to stop a service:

net stop servicename

To start a service:

net start servicename

To disable a service:

sc config servicename start= disabled

To enable a service:

sc config servicename start= demand

To make a service start automatically with system boot:

sc config servicename start= auto

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

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:

net start RpcSsTo stop Remote procedure call service

net stop RpcSs

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.

  • SS64
  • CMD
  • How-to

Start a program, command or batch script, opens in a new/separate Command Prompt window.

Always include a TITLE this can be a simple string like “My Script” or just a pair of empty quotes “”
According to the Microsoft documentation, the title is optional, but depending on the other options chosen you can have problems if it is omitted.

If is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. This means that the window will remain after the command has been run.

In a batch script, a command without will run the program and just continue, so a script containing nothing but a command will close the CMD console and leave the new program running.

Document files can be invoked through their file association just by typing
the name of the file as a command.
e.g. START “” MarchReport.DOC will launch the application associated with the .DOC file
extension and load the document.

To minimise any chance of the wrong exectuable being run, specify the full path to command or at a minimum include the file extension: START “” notepad.exe

If you START an application without a file extension (for example instead of then the PATHEXT environment variable will be read to determine
which file extensions to search for and in what order.
The default value for the PATHEXT variable is:

Start – run in parallel

In practice you just need to test it and see how it behaves.

Often you can work around this issue by creating a one line batch script ( ) to launch the executable, and then call that script with

Start /Wait

The option should reverse the default ‘run in parallel’ behaviour of but again your results will vary depending on the item being started, for example:

The above will start the calculator and wait before continuing. However if you replace with , to run Word instead, then the will stop working, this is because is a stub which launches the main Word application and then exits.

Add to have everything run in a single window.

In a batch file, an alternative is to use TIMEOUT to delay processing of individual commands.

START vs CALL

Starting a new process with CALL, is very similar to running , in both cases the calling script will (usually) pause until the second script has completed.

Starting a new process with CALL, will run in the same shell environment as the calling script. For a GUI application this makes no difference, but a second ‘called’ batch file will be able to change variables and pass those changes back to the caller.

In comparison will instantiate a new shell for the called batch. This will inherit variables from the calling shell, but any variable changes will be discarded when the second script ends.

Run a program

  • On the command line, CMD.EXE does not wait for the application to terminate and control immediately returns to the command prompt.
  • Running a program from within a batch script, CMD.EXE will pause the initial script and wait for the application to terminate before continuing.
  • If you run one batch script from another without using either or , then the first script is terminated and the second one takes over.

Multiprocessor systems

Processor affinity is assigned as a hex number but calculated from the binary positions (similar to NODRIVES)

Hex Binary        Processors
 1 00000001 Proc 1 
 3 00000011 Proc 1+2
 7 00000111 Proc 1+2+3
 C 00001100 Proc 3+4 etc

start /NODE 1 app1.exe
start /NODE 1 app2.exe

These two processes can be further constrained to run on specific processors within the same NUMA node.

start /NODE 1 /AFFINITY 0x3 app1.exe
start /NODE 1 /AFFINITY 0xc app2.exe

Running executable (. EXE) files

When a file that contains a .exe header, is invoked from a CMD prompt or batch file (with or without START), it will be opened as an executable file. The filename extension does not have to be .EXE. The file header of executable files start with the ‘magic sequence’ of ASCII characters ‘MZ’ (0x4D, 0x5A) The ‘MZ’ being the initials of Mark Zibowski, a Microsoft employee at the time the file format was designed.

Command Extensions

Non-executable files can be invoked through their file association just by typing the name of the file as a command. (e.g. WORD.DOC would launch the application associated with the .DOC file extension). This is based on the setting in , or if that is not specified, then the file associations – see ASSOC and FTYPE.

When executing a command line whose first token is the string without an extension or path qualifier, then is replaced with the value of the COMSPEC variable. This prevents picking up CMD.EXE from the current directory.

When executing a command line whose first token does NOT contain an extension, then CMD.EXE uses the value of the COMSPEC environment variable. This prevents picking up CMD.EXE from the current directory.

:/>  Как установить Windows 10 второй системой

When executing a command line whose first token does NOT contain an extension, then 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: Notice the syntax is the same as the PATH variable, with semicolons separating the different elements.

When searching for an executable, if there is no match on any extension, then looks to see if the name matches a directory name. If it does, the START command launches the Explorer on that path. If done from the command line, it is the equivalent to doing a CD /D to that path.

If the command is successfully started , typically this will be but if a previous command set an errorlevel, that will be preserved (this is a bug).
If the command fails to start then ERRORLEVEL = 9059
START /WAIT batch_file – will return the ERRORLEVEL specified by EXIT

START is an internal command.

Examples

Run a minimised Login script:
START “My Login Script” /Min Login.cmd

Start a program and wait for it to complete before continuing:
START “” /wait autocad.exe

Open a file with a particular program:
START “” “C:Program FilesMicrosoft OfficeWinword.exe” “D:Docsdemo.txt”

Open a webpage in the default browser, note the protocol is required (https://)

Open a webpage in Microsoft Edge:

or with a hard-coded path:
“C:Program Files (x86)Microsoft EdgeApplicationmsedge.exe”
https://ss64.com

Connect to a new printer: (this will setup the print connection/driver )

Start an application and specify where files will be saved (Working Directory):
START /D C:Documents /MAX “Maximised Notes” notepad.exe

“Do not run; scorn running with thy heels” ~ Shakespeare, The Merchant of Venice

Related commands

WMIC process call create “c:some.exe”,”c:exec_dir” – This method returns the PID of the started process.
CALL – Call one batch program from another.
CMD – can be used to call a subsequent batch and ALWAYS return even if errors occur.
TIMEOUT – Delay processing of a batch file/command.
TITLE – Change the title displayed above the CMD window.
RUN commands Start ➞ Run commands.
ScriptRunner – Run one or more scripts in sequence.
Run a script – How to create and run a batch file.
Q162059 – Opening Office documents.
Equivalent PowerShell: Start-Process – Start one or more processes.
Equivalent bash command (Linux) : open – Open a file in it’s default application.
Equivalent macOS command: open – Open a file in a chosen application.

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

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

При работе на компьютере, часто возникает необходимость использовать командную строку (cmd.exe) в режиме повышенных прав администратора. Для применения тех или иных настроек системы, необходимо иметь полные административные права, например, на компьютере появились неполадки, пользователь нашел способ решить проблему, а для этого потребуется использовать командную строку.

Для решения проблемы, запустите командную строку с правами администратора, выполните необходимые действия в интерфейсе командной строки (интерпретаторе командной строки).

В инструкциях этой статьи мы рассмотрим разные способы, как открыть командную строку от имени администратора в операционной системе Windows: в Windows 10, в Windows 8.1, в Windows 8, в Windows 7. Здесь вы найдете 5 универсальных способов, работающие во всех версиях Виндовс, и некоторые способы, применимые только для некоторых версий ОС.

Запуск командной строки от имени администратора Windows — 1 способ

Данный способ подойдет для всех версий Windows: Windows 10, Windows 8.1, Windows 8, Windows 7. Для вызова командной строки с полными административными привилегиями, используется функция поиска в операционной системе.

В Windows 7 войдите в меню «Пуск», в Windows 8 и Windows 8.1 поведите курсор мыши к правому верхнему или нижнему краю Рабочего стола, в Windows 10 поле поиска находится на Панели задач.

  • Введите в поисковое поле выражение «cmd» или «командная строка».
  • Нажмите правой кнопкой мыши по приложению, показанному в результатах поиска, выберите «Запуск от имени администратора».

MS-DOS and Windows command line start command

Как включить командную строку от имени администратора — 2 способ

Следующий способ, позволяющий открыть командную строку с полными правами, в разных версиях операционной системы Windows: запуск утилиты из меню «Пуск».

  • Войдите в меню «Пуск» (в Windows 8.1 и в Windows 8 нужно перейти на экран «Приложения»).
  • Среди программ, в папке «Служебные — Windows» (в Windows 7 – «Стандартные») найдите программу «Командная строка».
  • Щелкните по приложению правой кнопкой мыши, выберите «Запустить от имени администратора».

MS-DOS and Windows command line start command

Как вызвать командную строку от имени администратора — 3 способ

Есть еще один способ для открытия командной строки от имени администратора в любой версии Windows. Для этого потребуется запустить утилиту cmd.exe непосредственно из папки, где она находится в операционной системе.

  • Откройте в Проводнике системный диск «C:».
  • Войдите в папку «Windows», перейдите в папку «System32».
  • Кликните правой кнопкой мыши по приложению «cmd», в контекстном меню выберите «Запуск от имени администратора».

MS-DOS and Windows command line start command

Как запустить командную строку с правами администратора — 4 способ

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

  • Запустите Диспетчер задач.
  • Войдите в меню «Файл», выберите «Запустить новую задачу».
  • В окне «Создание задачи», в поле открыть введите «cmd» (без кавычек), поставьте флажок напротив пункта «Создать задачу от имени администратора», а затем нажмите на кнопку «ОК».

MS-DOS and Windows command line start command

Запуск командной строки с правами администратора — 5 способ

В этом способе мы создадим специальный ярлык для запуска приложения cmd.exe с правами администратора.

  • Войдите в папку по пути: «C:WindowsSystem32».
  • Щелкните по ярлыку правой кнопкой мыши, выберите «Свойства».
  • В окне «Дополнительные свойства» установите галку, напротив пункта «Запуск от имени администратора», нажмите на кнопку «ОК».

MS-DOS and Windows command line start command

Командная строка Windows 10 от имени администратора

В начальных версиях Windows 10 можно было легко вызвать командную строку. Затем, Майкрософт несколько изменила свою политику: вместо командной строки предлагается использовать Windows PowerShell (более продвинутый аналог командной строки), поэтому некоторые способы запуска командной строки, перестали работать в операционной системе.

:/>  Как отключить запуск дискорда при включении компьютера windows 10

Вернуть командную строку на прежнее место, вместо Windows PowerrShell, можно по инструкции из этой статье.

  • Одновременно нажмите на клавиши «Win» + «X».
  • В открывшемся окне вы увидите пункт «Командная строка (администратор)», находящийся на прежнем месте.

MS-DOS and Windows command line start command

Командная строка от имени администратора Windows 8

Самый простой способ запуска командной строки в операционной системе Windows 10: из меню «Пуск» на Рабочем столе.

  • На Рабочем столе кликните правой кнопкой мыши по меню «Пуск».
  • В открывшемся меню нажмите на пункт «Командная строка (администратор)».

MS-DOS and Windows command line start command

Этот способ работает в операционных системах Windows 8 и Windows 8.1. В Проводнике Windows 10, вместо командной строки, нам предлагают использовать Windows PowerShell.

  • Запустите Проводник Windows.
  • Войдите на какой-нибудь диск или откройте любую папку.
  • В окне Проводника щелкните левой кнопкой мыши по меню «Файл».
  • В контекстном меню выберите сначала «Открыть командную строку», а затем «Открыть командную строку как администратор».

MS-DOS and Windows command line start command

Командная строка от имени администратора Windows 7

В операционной системе Windows 7 работают все универсальные способы, описанные в этой статье:

  • В меню «Пуск» введите «cmd» или «командная строка», кликните по приложению правой кнопкой, запустите от имени администратора.
  • Войдите в меню «Пуск», далее «Все программы», затем «Стандартные», потом «Командная строка», с помощью правой кнопки запустите командную строку с правами администратора.
  • Запуск «cmd.exe» из папки по пути: «C:WindowsSystem32».
  • Открытие командной строки с помощью задания в Диспетчере задач.
  • Со специально созданного ярлыка на Рабочем столе.

Выводы статьи

В случае необходимости, пользователь может запустить инструмент «командная строка» с полными правами от имени администратора в операционной системе Windows. В статье описаны разные способы запуска командной строки от имени администратора, работающие в операционных системах: Windows 10, Windows 8.1, Windows 8, Windows 7.

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

Запуск по названию исполняемого файла

Многие программы в командной строке можно запускать просто указав название их исполняемого файла. Например, вы можете ввести в командную строку «» и запустить программу «» или ввести «» и запустить «».

MS-DOS and Windows command line start command

Это работает благодаря переменной окружения «» в которой записан список папок, где Windows должна искать исполняемые файлы для программ. Список этих папок можно просмотреть, если ввести в командную строку команду «».

MS-DOS and Windows command line start command

Если вы хотите запустить программу из другой папки, которая не указана в переменной «», то вы можете временно изменить папку для поиска исполняемых файлов. Для этого нужно ввести команду «» и через пробел указать путь к нужной папке. Например, мы можем указать путь к папке с программой AkelPad:

path “C:Program Files (x86)AkelPad”

И потом запустить эту программу выполнив команду «akelpad»:

MS-DOS and Windows command line start command

Нужно отметить, что команда «path» влияет только на текущий сеанс командной строки, при этом значение переменной «» не меняется.

Запуск с указанием полного пути

Еще один способ запуска программ – это указание полного пути к исполняемому exe-файлу. Для этого достаточно вставить в командную строку полный путь и указанная программа будет запущена.

Например, для запуска программы AkelPad в командную строку нужно вставить следующее:

“C:Program Files (x86)AkelPadAkelPad.exe”

MS-DOS and Windows command line start command

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

Запуск с помощью команды «start»

Также для запуска других программ можно использовать команду «s». С ее помощью можно запускать как программы для командной строки, так и приложения с графическим интерфейсом.

Для запуска программ данным способом нужно ввести команду «» и через пробел указать название программы. Например, для того чтобы запустить текстовый редактор «Блокнот» нужно выполнить следующее:

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

MS-DOS and Windows command line start command

Но, команда «» позволяет и вручную указать путь к папке с программой. Для этого нужно использовать параметр «».

Например, для того чтобы запустить программу «» из папки «C:Program Files (x86)AkelPad» нужно выполнить следующее:

start /D “C:Program Files (x86)AkelPad” akelpad

MS-DOS and Windows command line start command

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

Как перезапустить программу через командную строку

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

Для остановки запущенной программы можно использовать команду taskkill. Например, чтобы принудительно (параметр ) останавить работу процесса «» нужно выполнить:

taskkill /F /IM Viber.exe

После остановки программы ее можно повторно запустить с помощью команды «». Например, чтобы перезапустить Viber через командную строку нужно выполнить:

start /D “%LocalAppData%Viber” Viber

Здесь «» — это путь к папке с программой, а «» — название исполняемого exe-файла в этой папке.

Эти две команды можно объединить в одну с помощью оператора «». В этом случае команда для перезапуска Viber будет выглядеть так:

taskkill /F /IM Viber.exe && start /D “%LocalAppData%Viber” Viber

Обратите внимание, завершая программы с помощью «» вы можете потерять несохраненные данные.

Создатель сайта comp-security.net, автор более 2000 статей о ремонте компьютеров, работе с программами, настройке операционных систем.

Задайте вопрос в комментариях под статьей или на странице
«Задать вопрос»
и вы обязательно получите ответ.

Updated: by

Availability

start /NODE 1 /AFFINITY 0x3 application1.exe start /NODE 1 /AFFINITY 0xc application2.exe

non-executable files may be invoked through their file association by typing the name of the file as a command. (e.g., WORD.DOC would launch the application associated with the .DOC file extension). See the ASSOC and FTYPE commands for how to create these associations from within a command script.

When executing an application that is a 32-bit GUI application, CMD.EXE does not wait for the application to terminate before returning to the command prompt. This new behavior does NOT occur if executing in a command script.

When executing a command line whose first token is the string “CMD” without an extension or path qualifier, then “CMD” is replaced with the value of the COMSPEC variable. This change prevents picking up CMD.EXE from the current directory.

When executing a command line whose first token does NOT contain an extension, CMD.EXE uses the value of the PATHEXT environment variable to determine the extension. The default value for the PATHEXT variable is:

:/>  Как создать загрузочную флешку с Windows 10?

Notice the syntax is the same as the PATH variable, with semicolons separating the different elements.

When searching for an executable, if there is no match on any extension, then looks to see if the name matches a directory name. If it does, the START command launches the Explorer on that path. If done from the command line, it is the equivalent to doing a CD /D to that path.

Windows XP and earlier syntax

When executing a command line whose first token is the string “CMD ” without an extension or path qualifier, then “CMD” is replaced with the value of the COMSPEC variable. This change prevents picking up CMD.EXE from the current directory.

Start examples

start notepad myfile.txt

Start a new instance of Notepad with the file myfile.txt.

start /MAX notepad

Start the notepad window with the screen maximized.

start /MIN mybatch.bat

The above example would start the batch file mybatch.bat in a minimized window.

start c:music”my song.mp3″

If the file or folder has a space in it, you must surround it with quotes. In the above example, we’re starting the MP3 song file “my song.mp3”. Without the quotes surrounding the file name with a space, you would get a Windows cannot find the file error.

Open the Computer Hope web page in your default browser from the command line.

Запускает определенную программу или команду в отдельном окне. При запуске без параметров
команда start создает новое окно командной строки.

Синтаксис

Указывает заголовок, выводимый в области заголовка окна.

Указывает каталог запуска.

Передает начальные установки среды интерпретатора Cmd.exe в новое окно командной строки.

Запускает новое окно командной строки в свернутом виде.

Запускает новое окно командной строки в развернутом виде.

Запускает 16-битные программы в отдельном пространстве памяти.

Запускает приложение с низким приоритетом.

Запускает приложение с нормальным приоритетом.

Запускает приложение с высоким приоритетом.

Запускает приложение с приоритетом реального времени.

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

Запускает приложение с приоритетом ниже среднего.

Запускает приложение с ожиданием окончания его работы.

Запускает приложение без открытия нового окна командной строки. Обработка комбинации клавиш
CTRL+C не производится, пока приложение не разрешит обработку CTRL+C. Для прерывания
приложения следует использовать CTRL+BREAK.

Задает команду или программу для запуска.

Задает параметры, которые будут переданы вызываемой программе.

Примеры

Для того чтобы запустить программу Myapp, но при этом остаться в текущем окне командной
строки, следует использовать следующую команду:

Start command can be used to run a command/batch file in another command window or to launch an application from command line.  Below you can find the command’s syntax and some examples.

Launch another command window:

This command opens a new command prompt window.
Run a command in a separate window

This command opens a new command window and also runs the specified command. If the command is of a GUI application, the application will be launched with out any new command window.

Examples:
Launch new command window and run dir command.:

Run a command in another window and terminate after command execution:

start cmd /c command

For example, to run a batch file in another command window and to close the window after batch file execution completes, the command will be:

Start cmd /c  C:mybatchfile.bat

Run the command in the same window:

Start /b command

Run a command in the background like we do using ‘&’ in Linux:

In Windows, we can do similar thing by using start command. But here it does not run in background. A new command window will be executing the specified command and the current window will be back to prompt to take the next command.

Start command
(or)
Start batchfile.bat

Launch a GUI application:

For example, to launch internet explorer, we can use the below command.

Open windows explorer in the current directory:

I would like to run two programs simultaneously from a batch file, and redirect the first program’s output into a text file like:

While the programs run as expected, all output is shown on stdout.

asked Sep 21, 2011 at 17:06

You might need to do it this way:

MS-DOS and Windows command line start command

answered Sep 21, 2011 at 17:30

Additionally, if you want to redirect both stderr and stdout this works for me

It seems every character basically needs to be escaped. This command normally looks like this:

answered Apr 16, 2015 at 8:14

2 silver badges6 bronze badges

Redirection is applied to the start command, but somehow not to the cmd.exe instance it runs.

answered Sep 21, 2011 at 17:27

61 gold badges867 silver badges933 bronze badges

What did the trick for me was moving the command into a separate batch file:

rem this first batch file triggers the second one:
start the_second.bat arg1 arg2 out.txt

the_second.bat then looks like this:

answered Jul 26, 2016 at 14:30

start /b “” “c:Program FilesOracleVirtualBoxVBoxHeadless.exe” -startvm “debian604 64”

If you read the parameter list with start /?:

It expects a title enclosed in quotes (“). Since your program path included quotes, it got interpreted as the title. Adding an explicit title (in this case, empty, “”) works.

An alternative method is using the /d switch to specify the path. Specifically:

start /b /d “c:Program FilesOracleVirtualBox” VBoxHeadless.exe -startvm “debian604 64”

It appears to take the first argument after the /d switch as the path, even if it is quoted, and if the next argument is not quoted then this works. Everything after what is recognised as the command/program is passed as a parameter to that command/program. Note this will not work if the command/program has spaces in the name, e.g. VBox Headless.exe, since that would require quotes and be recognised as a title.

Overall, the first (explicit title) method is probably better. It was a bad design choice on the part of Microsoft, they really should have added a switch for title rather than “is the first argument enclosed in quotes?”.

Оставьте комментарий