- Как запустить программу через командную строку Windows
- 1 способ: запуск системного приложения
- 2 способ: указав полный путь к файлу
- 3 способ: используя path
- 4 способ: с помощью команды cd
- 5 способ: через контекстное меню
- 6 способ: путь в кавычках
- Uninstall programs from windows command line
- Uninstall Java SDK/JDK from command prompt
- Uninstall MySql server from command prompt
- Uninstall web folders
- How to check if Windows 32 or 64 bit?
- Get Windows install date
- User questions about fixing javac not recognized error
- How to Kill process from PowerShell
- Fix WMIC invalid alias verb error
- How to remove user login password from command prompt
- Run command for performance monitor
- PowerShell – Failed to update help for the modules
- Run command for remote desktop (RDP client)
- Find saved outlook emails
- Windows Terminal Tips and Tricks
- On first launch
- Customization
- Global profile settings
- Custom color schemes
- Custom command line
- Old school fonts
- Places for background images
- Functionality
- wt.exe command line arguments
- Panes
- Copy and paste
- Defining key bindings and actions
- Send input commands
- WSL starting directory
- Cheers
Как запустить программу через командную строку Windows
Большинство пользователей операционной системы Windows привыкли запускать нужное приложение или игру двойным кликом по ярлыку, расположенному на рабочем столе, или найдя его в Пуске. Как вариант, можно открыть папку, в которой оно установлено, и уже оттуда запустить exe-шный файл.
Поскольку такой запуск приложений может подойти не всегда, в данной статье давайте рассмотрим несколько различных способов, используя которые получится запустить программу из командной строки.
Для начала нужно открыть окно консоли. Как это сделать, подробно описано в статье: вызов командной строки Windows.
1 способ: запуск системного приложения
Для того чтобы запустить из консоли одно из системных приложений используется команда «start» и через пробел указывается нужное название. В качестве названия нужно прописать системное имя. Для Проводника – это explorer , диспетчера задач – taskmgr , панель управления – control , конфигурация системы – msconfig .
Чтобы открыть блокнот напишите notepad , проигрыватель Windows Media – wmplayer , Paint – mspaint , таблицу символов – charmap . Если напишите cmd , откроется новое окно командной строки.
Например, откроем таблицу символов. Наберите в строке:
и нажмите «Enter» .
2 способ: указав полный путь к файлу
Если вам нужно запустить любое другое установленное приложение, тогда следует указать полный путь к исполняемому файлу программы.
Например, у меня в папке Загрузки есть программа для установки Киностудии, давайте ее откроем. Захожу в папку и кликаю мышкой по полю, где прописан путь. Всю эту строку нужно прописать в командной строке (поскольку скопировать-вставить там не работает) и в конце дописать название утилиты, которую хотим запустить.
В консоли будет написано:
После нажатия «Enter» началась подготовка к установке Киностудии. Как видите, прописывая путь необязательно использовать большие буквы, можно вводить только маленькие.
Если же в пути к нужному файлу будут пробелы, тогда появится окно с сообщением, что найти указанный файл не получается. Дело в том, что командная строка распознает путь до первого пробела, а не всю введенную вами строку. В примере, она решила, что я хочу открыть c:\program .
Теперь немного отойдем от темы, и рассмотрим, как узнать полный путь к той программе, которую мы хотим запустить.
Для этого найдите через окно Проводника исполняемый файл нужного приложения. Чтобы понять, что это он, посмотрите, чтобы напротив него в поле «Тип» было указано «Приложение» . Дальше кликните по полю вверху – это и есть путь.
Например, Тотал Коммандер запускается файлом «totalcmd» , а он находится по пути: «c:\program files\total commander» .
Или еще один вариант. Если на рабочем столе есть ярлык нужного приложения, его можно не искать через Проводник. Достаточно кликнуть по нему правой кнопкой и выбрать пункт «Расположение файла» .
Откроется окно, которое мы уже рассмотрели. В нем будет выделен файлик, который запускает утилиту, а вверху можно узнать к ней путь.
3 способ: используя path
С помощью этой команды мы сохраним путь к той папке, в которой находится исполняемый файл, а потом запустим его.
Рассмотрим все тот же Тотал Коммандер. В консоли пишем:
path c:\program files\total commander
После «path» обязательно ставьте пробел. Именно по этому пути находится нужный нам файл «totalcmd» . Нажимайте «Enter» .
Дальше прописывайте название exe-шного файла. У меня это:
Указанная программа будет запущена. В конце необязательно указывать расширение. Таким образом, можно запустить любой исполняемый файл в указанной папке.
4 способ: с помощью команды cd
Эта команда откроет указанную папку, и уже из нее мы запустим нужный нам файл. Например, зайдем в папочку TeamViewer:
cd c:\program files\teamviewer
После «cd» поставьте пробел. Жмите «Enter» .
В этой папке хранится файл, которым запускается TeamViewer, он имеет одноименное название. Поэтому дальше ввожу:
нажимаю «Enter» и утилита запускается.
Если нужно открыть приложение, которое установлено не на системном диске, то использовать можете команду path . Если я наберу:
path d:\program files\ccleaner
(после ввода каждой строки жмите «Enter» ), то у меня откроется CCleaner. Именно он установлен по указанному пути на диске D: .
А вот с помощью команды cd этого сделать не получится.
5 способ: через контекстное меню
Для этого найдите ту папку, в которой хранится исполняемый файл, и нажмите по ней правой кнопкой мыши, при этом зажав и удерживая клавишу «Shift» . Дальше в контекстном меню выберите «Открыть окно команд» .
После этого в командной строке сразу откроется нужная нам папка. Введите в строку название файла, который запускает утилиту, и жмите «Enter» . Это мы запустили CCleaner, расположенный не на системном диске (у меня D: ).
Если нужно запустить программу, которая установлена там же, где и операционная система, действия те же. Давайте откроем браузер Google Chrome. Находим папку, в которой хранится файл, что его запускает, и выбираем упомянутый выше пункт.
Затем вводим название файла с расширением .*exe : chrome , и жмем «Enter» . Браузер будет запущен.
6 способ: путь в кавычках
В начале, я упомянула, что если в прописанном пути будут пробелы, файл не откроется. Но если написать его в кавычках, то консоль все поймет. Кавычки должны быть двойные и прямые, а не в виде запятых. Ставятся они с помощью комбинации «Shift+Э» с выбранной английской раскладкой клавиатуры.
В них нужно написать полностью путь и в конце указать сам файл с расширением, который будет запущен:
«c:\program files\total commander\totalcmd.exe»
Используя кавычки, можете открывать программы и на системном диске и на диске с данными.
Это все известные мне способы, которые помогут открыть нужную программу непосредственно из командной строки Windows. Если знаете что-то еще, пишите в комментариях.
Uninstall programs from windows command line
Sometimes we will have to uninstall a program or software in automated way which does not require any user interaction. We can use wmic product command in such scenarios. Below you can find the syntax and also few examples.
Below is the command we need to use to uninstall a program.
Note that you need to provide accurate program name along with the version if it’s part of the program name. wmic product get lists all the installed programs in the command prompt. You can use findstr command in combination with wmic command.
Below are few examples for uninstalling different programs.
Uninstall Java SDK/JDK from command prompt
First you need to find the version of the Java installed on the system.
I have above versions of JDK on my system. Let’s say we want to uninstall ‘Java 7 Update 79 (64-bit)’
Uninstall MySql server from command prompt
You can use the below command to install Mysql server 5.5
For example to get the program name for mysql you can use the below command.
Uninstall web folders
This wmic command should be run from eleavated administrator command prompt. Otherwise, it throws up an error like below.
If you get the error No Instance(s) Available , it means that there’s no such product installed on your system. Double check if you have got the product description accurately.
You forgot to write, that WMIC shows information only about products installed by .msi installer.
C:\WINDOWS\system32>wmic [enter]
‘wmic’ is not recognized as an internal or external command, operable program, or batch file
From Windows XP Home edition SP3
I am not able to uninstall some programs eg. opera and etc using either control panel or cmd prompt. Plz help mr out here and sugest some ways. Thanx
Tqu So much Lot of Use..
Why do you sometimes (not always) need a space before the 2nd double-quote?
I want to uninstall Microsoft Word in windows 10. Possible steps.
Thanks.
How to check if Windows 32 or 64 bit?
There are multiple ways to check whether a Windows computer is running 32-bit OS or of 64-bit one. Check 32 or 64 bit using WMIC You can get to know the OS architecture by running the below simple command. wmic os get OSArchitecture Example: c:\>wmic os get OSArchitecture OSArchitecture 64-bit c:\> Using program files folder: [. ]
Get Windows install date
If you ever need to find when was Windows installed on your computer or laptop, then here is a Windows command Systeminfo that can help you with that. Run the below Open command prompt Run the command systeminfo | findstr /C:»Install Date» The below example shows install date on my computer C:\>systeminfo | findstr /C:»Install [. ]
User questions about fixing javac not recognized error
Of all my posts, the one that gets most number of comments is – “Javac is not recognized as internal or external command” Due to heavy incoming comments, I stopped approving them long back to avoid the page become a giant one. However there are still users who’ve been commenting that they were not able [. ]
How to Kill process from PowerShell
Powershell provides command Stop-Process to kill a process from command prompt. This command can take in process Id, process name etc and can kill process from CMD. Powershell command to Kill a process using name Below is an example command to kill a process using name of the application or image file. Stop-Process -Name ApplicationName [. ]
Fix WMIC invalid alias verb error
If you use WMIC commands extensively, you would have come across the error – ‘Invalid alias verb’. WMIC error messages are not much self explanatory, so they don’t help in debugging what’s wrong with the command you ran. I encountered this error quite a few times, and upon careful examination I was able to identify [. ]
How to remove user login password from command prompt
For Windows home users, having a login password is not absolutely necessary if the physical access to the device is restricted. Also, anyone running automated tests with login, you may want to enable login automatically without being prompted for a password. Learn how to remove user password for a local user from windows command prompt. [. ]
Run command for performance monitor
Run the following steps to open performance monitor application on Windows computer. Press Windows+R to open run windowType ‘Perfmon’ and press enter. This open the performance monitor application. Performance monitor on Windows 10
PowerShell – Failed to update help for the modules
Powershell help manuals can be updated by running the command ‘Update-Help’ from Powershell command prompt. If you run this command from a normal cmd session, you would get an error as below. PS C:\> update-help update-help : Failed to update Help for the module(s) : ‘AppBackgroundTask, AppLocker, AppvClient, Appx, AssignedAccess, BitLocker, BitsTransfer, BranchCache, CimCmdlets, ConfigCI, [. ]
Run command for remote desktop (RDP client)
The Run command for Windows Remote desktop application is Mstsc Just open Run from start menu and type mstsc in the text box next to open and press enter. This command mstsc can be used from command line too. A system running Windows 7/Windows 10 allows only one remote desktop connection at a time, means [. ]
Find saved outlook emails
It’s a common practice to export Outlook emails as files on disk, this helps save your important emails from accidental deletion or purging out/archiving due to IT enforced policies. It may so happen that now you don’t remember which folder you saved the emails to. This post helps you find them. Here is how you [. ]
Windows Terminal Tips and Tricks
October 15th, 2020
Windows Terminal comes with a lot of features that allow you to customize it and interact with it in a way that feels most comfortable to you. Let’s run through some tips and tricks that could help you set up your terminal in a way that’s perfect for you. At the time of this blog post, Windows Terminal is on version 1.3 and Windows Terminal Preview is on version 1.4.
On first launch
When you first install Windows Terminal, you will be greeted with a Windows PowerShell prompt. Windows Terminal ships with Windows PowerShell, Command Prompt, and Azure Cloud Shell profiles by default.
In addition to these profiles, if you have any Windows Subsystem for Linux (WSL) distributions installed, the terminal will automatically create profiles for those distros as well. If you would like to install additional WSL distros on your machine, you can do so after installing terminal and on your next terminal launch, the profiles for those distros should automatically appear. These profiles will have Tux as their icon, however you can change the icon of the distro in your settings to match whichever distro you have. You can find more information about WSL on the WSL docs site.
👉 Note: You will have to download the distro icons as they do not come shipped inside the terminal.
Customization
Windows Terminal comes with a large set of default settings, including color schemes and keyboard shortcuts. If you’d like to view the default settings file, you can hold Alt and click on the Settings button inside the dropdown menu.
Global profile settings
Windows Terminal provides you the option of applying a setting to every profile without having to duplicate the setting for each profile entry. This can be done by adding a setting inside the «defaults» array inside the «profiles» object. A list of all possible profile settings can be found on the Profile settings page on our docs site.
Custom color schemes
Windows Terminal comes with an assortment of color schemes by default. However, there are unlimited possibilities when it comes to color schemes. A great place to find additional terminal schemes is terminalsplash.com.
If you’d like to create your own color scheme, terminal.sexy is a great tool for creating and visualizing your own color schemes.
💡 Tip: You can match your custom color scheme to a background image by using the PowerToys color picker to grab hex codes for colors to use inside your scheme. PowerToys can be installed using winget with winget install powertoys .
Custom command line
You can give your command line some style with Oh my Posh and Terminal-Icons. These tools allow you to customize what your prompt looks like with colors, glyphs, and emojis. To get Oh my Posh with Posh-Git and PSReadline up and running, you can follow this tutorial.
Oh my Posh recently came out with Oh my Posh 3, which has a lot more customization options and is not only exclusive to PowerShell. After going through the tutorial linked above, you can upgrade to V3 with the following command:
You can add a bit more flair to your shell by adding custom icons with Terminal-Icons. The image below is also using a custom Posh theme to add emojis to the prompt line.
👉 Note: You will need to set your font to a Nerd Font in order to get the Terminal Icons to appear.
Old school fonts
For those of you who are fans of the retro terminal effect, a great place to find old school fonts is at https://int10h.org/oldschool-pc-fonts/.
Places for background images
Desktop wallpapers often look great inside Windows Terminal as background images. Some great places to find background images are Windows Themes as well as WallpaperHub. Windows Terminal supports both images and gifs for background images.
Another popular option is placing the logo of the shell you are using as the background image, to help identify which shell you are in. You can set where the background image is placed with «backgroundImageAlignment» in your settings. More information on background image settings can be found on our docs site.
Functionality
wt.exe command line arguments
You can launch your terminal in a specific configuration by using the wt.exe command. Some options you can set are tab and pane arrangements as well as their starting directories and profiles. You can save a custom command as a shortcut and pin it to your taskbar to open your desired configuration.
If you use the wt.exe command inside the command palette, it will take effect in your current terminal window, rather than spinning up a new terminal instance.
This example will open the PowerShell profile in the current working directory in a new tab with a vertical pane running your default profile.
wt -p «PowerShell» -d . ; split-pane -V
Full documentation about wt command line arguments can be found on our docs site.
Panes
Windows Terminal has pane support for profiles. You can open a new pane of a profile by either holding Alt and clicking on the profile in the dropdown, or by using the following keyboard shortcuts:
Automatic pane split of current profile
Horizontal pane split of default profile
Alt + Shift + Minus
Vertical pane split of default profile
Alt + Shift + Plus
You can also move focus around your panes by holding Alt and using the arrow keys. Lastly, you can resize your panes by holding Alt + Shift and using the arrow keys. You can find more information about panes on our docs site.
Copy and paste
In Windows Terminal, the default keyboard shortcuts for copy and paste are Ctrl + C and Ctrl + V , respectively. If you do not have a selection, Ctrl + C will act as normal as the break command.
You can customize which keys you’d like to copy and paste with by editing the «copy» and «paste» key bindings. If you delete these key bindings from your settings.json, the terminal will default to Ctrl + Shift + C and Ctrl + Shift + V . This can be especially helpful for WSL users who need Ctrl + C and Ctrl + V free to use for their shells.
You can also choose which formatting is copied to your clipboard along with newline characters with the «copyFormatting» and «singleLine» actions associated with the copy command. Full documentation on clipboard integration commands can be found on our docs site.
Defining key bindings and actions
A large portion of the customizable properties inside Windows Terminal come from key bindings and actions. Commands inside the «actions» array will automatically be added to your command palette. If you’d like to also use them with key bindings, you can add «keys» to them to invoke them with the keyboard. A full list of every possible command can be found on the Actions page of our docs site.
Send input commands
Windows Terminal gives you the ability to send input to your shell with a key binding. This can be done with the following structure inside your «actions» array.
Sending input to the shell with a keyboard shortcut can be useful for commands you run often. One example would be clearing your screen:
Navigating to the parent directory with a key binding may also be helpful.
You can also use this functionality to run builds or test scripts.
WSL starting directory
As of now, Windows Terminal defaults to setting WSL profiles’ starting directory as the Windows user profile folder. To set your WSL profile to start in the
folder, you can add the following line to your profile settings, replacing DISTRONAME and USERNAME with the appropriate fields.
Cheers
We hope you learned a few tips and tricks about Windows Terminal throughout this blog post. We are currently planning another release for the month of November, so keep your eyes peeled for that one! If you have any questions or feedback, feel free to reach out to Kayla (@cinnamon_msft) on Twitter. For more information about Windows Terminal, you can check out our docs site.
Kayla Cinnamon
Program Manager, Windows Terminal, Console, Command Line, & Cascadia Code