Command line options. Command Line Programs for Everyday Use Using Command Line Options

Most users of the Windows operating system are accustomed to launching the desired application or game by double-clicking on the shortcut located on the desktop, or by finding it in Start. Alternatively, you can open the folder where it is installed and run the exe file from there.

Since this launch of applications may not always be suitable, in this article let's look at several different ways, using which you can launch a program from command line.

Method 1: Launching a system application

In order to start one of the system applications from the console, the “start” command is used and the desired name is indicated with a space. The name must be the system name. For Explorer, this is explorer , task manager - taskmgr , control panel - control , system configuration - msconfig .

To open notepad write notepad , Windows Media Player - wmplayer , Paint - mspaint , symbol map - charmap . If you write cmd , a new command prompt window will open.

For example, let's open a symbol table. Type in line:

and press "Enter".

Method 2: specifying the full path to the file

If you need to run any other installed application, then you should specify the full path to the executable file of the program.

For example, in my Downloads folder there is a program for installing Movie Maker, let's open it. I go into the folder and click on the field where the path is registered. This entire line must be written on the command line (since copy-paste does not work there) and at the end add the name of the utility that we want to run.

The console will say:

c:\users\master\downloads\wlsetup-all

After pressing "Enter", preparations for the installation of the Film Studio began. As you can see, it is not necessary to use capital letters when writing the path, you can only enter small letters.

If on the way to desired file there will be spaces, then a window will appear with a message that the specified file cannot be found. The point is that the command line recognizes the path up to the first space, not the entire string you entered. In the example, she decided that I wanted to open c:\program .

Now let's deviate a little from the topic, and consider how to find out the full path to the program that we want to run.

To do this, find through the Explorer window executable file desired application. To understand that it is him, look so that in front of him in the field "Type" is indicated "Application". Then click on the field at the top - this is the path.

For example, Total Commander is launched by the "totalcmd" file, and it is located along the path: "c:\program files\total commander".

Or another option. If there is a shortcut to the desired application on the desktop, you can not search for it through Explorer. Just right-click on it and select "File location".

The window that we have already discussed will open. It will highlight the file that launches the utility, and at the top you can find out the path to it.

3 way: using path

With this command, we will save the path to the folder where the executable file is located, and then run it.

Consider the same Total Commander. In the console we write:

path c:\program files\total commander

Be sure to include a space after "path". It is along this path that the file we need is "totalcmd". Press "Enter".

The specified program will be launched. You don't need to include an extension at the end. Thus, it is possible to run any executable file in the specified folder.

4 way: using the cd command

This command will open the specified folder, and from there we will run the file we need. For example, let's go to the TeamViewer folder:

cd c:\program files\teamviewer

Put a space after "cd". Press "Enter".

This folder contains the file that starts TeamViewer, it has the same name. So I enter:

I press "Enter" and the utility starts.

If you need to open an application that is not installed on the system drive, you can use the path command. If I type:

path d:\program files\ccleaner

(after entering each line, press "Enter"), then CCleaner will open for me. It is he who is installed at the specified path on the D: drive.

But with the help of the cd command, this will not work.

5 way: through the context menu

To do this, find the folder in which the executable file is stored, and right-click on it while holding down the "Shift" key. Then select from the context menu "Open command window".

After that, the folder we need will immediately open in the command line. Enter in the line the name of the file that launches the utility, and press "Enter". It was we who launched CCleaner, located not on the system drive (I have D:).

If you need to run a program that is installed in the same place as the operating system, the steps are the same. let's open Google browser Chrome. We find the folder in which the file is stored, which launches it, and select the item mentioned above.

Then we enter the name of the file with the extension . * exe: chrome , and press "Enter". The browser will be launched.

6 way: path in quotes

At the beginning, I mentioned that if there are spaces in the specified path, the file will not open. But if you write it in quotes, then the console will understand everything. Quotes must be double and straight, not commas. They are set using the combination "Shift + E" with the selected English keyboard layout.

You need to write the full path in them and at the end specify the file itself with the extension that will be launched:

"c:\program files\total commander\totalcmd.exe"

Using quotes, you can open programs on both the system drive and the data drive.

Command line options are used to define various launch options for Mozilla applications. For example, you can use command line options to bypass the Profile Manager and open a specific profile (if you have more than one). You can also control how Mozilla applications open, which components to open initially, and what to do when they open. This page describes commonly used options and how to use them.

Syntax Rules

First, let's describe the syntax rules that apply to all options.

  • Command parameters containing spaces must be enclosed in quotation marks, such as "Joel User" .
  • Command actions are case insensitive.
  • Command parameters (except for the profile name) are not case sensitive.
  • Commands and parameters are separated by spaces.
  • Message fields use the syntax field=value, For example:
    • to= [email protected]
    • subject=cool page
    • attachment=www.mozilla.org
    • attachment="file:///c:/test.txt"
    • body=check this page
  • Multiple message fields are separated by a comma (,) , for example: " [email protected],subject=cool page" . There must be no spaces before or after the separating comma. To specify multiple values ​​for a field, enclose the values ​​in single quotation marks (") , for example: " to=" [email protected],[email protected]",subject=cool page" .

Using command line options

Command line options are specified after the command to run the application. Some options take arguments. They are specified after the command line option. Some options are abbreviated. For example, the command line option "-editor" can be shortened to "-edit" . (Available abbreviations are described in the text below). In some cases, option arguments must be enclosed in quotation marks. (This is noted in the option descriptions below). Multiple command line options may be specified. In general, their syntax is as follows:

Application -option -option "argument" -option argument

Examples

The following examples illustrate the use of the "-ProfileManager" option, which opens the Profile Manager before starting Firefox or Thunderbird:

Windows

Select Run from the Windows Start menu and type:

Firefox-ProfileManager

MacOS X

Go to Applications > Utilities. Open terminal and type:

/Applications/Firefox.app/Contents/MacOS ./firefox-ProfileManager

linux

Open terminal and type:

CD Thunderbird installation directory ./thunderbird -ProfileManager

The example above uses the "-ProfileManager" command line option for the Mozilla Thunderbird email client.

User profile

-CreateProfile profile_name

Creates a new profile named profile_name in the default directory, but does not start the application. The profile_name value must not contain spaces () .

Firefox -CreateProfile JoelUser

-CreateProfile "profile_name profile_dir"

Creates a new profile profile_name in the profile_dir directory, but does not start the application. Note that profile_name and profile_dir are quoted together, separated by exactly one space () .

For successful use, there must be no instances of the application already running or the -no-remote option must be used.

Note: The profile_dir directory must not exist and you must not have an existing profile named profile_name .

Firefox -CreateProfile "JoelUser c:\internet\moz-profile"

-ProfileManager

Launching the Profile Manager. Short form: -P (no username).

-P "profile_name"

Skips the launch of the profile manager and launches the application with the profile_name . Useful when working with multiple profiles. Note that the profile name profile_name is case sensitive. If no profile name is specified, the profile manager will be launched. You must use uppercase P on Linux versions less than 7.x, as lowercase will cause it to run in cleanup mode ( leak detection memory). On other platforms, both upper and lower case are allowed.

Firefox -P "Joel User"

-profile "profile_path"

Run with a profile with the specified path. Only Firefox, Thunderbird And SeaMonkey2.x.

The "profile_path" path can be either absolute (" /path/to/profile ") or relative (" path/to/profile ").

Note: Specifying a relative path on Mac OS X is no longer supported due to a regression starting with Firefox 4.0 and later, see bug 673955 .

-new-instance

Launches a new instance of the application instead of a new window in an already running application, allowing multiple instances of the application to be open at the same time.

Firefox -new-instance -P "Another Profile"

-no-remote

Does not allow receiving or sending remote commands; implicit use of the -new-instance option.

Firefox -no-remote -P "Another Profile"

Note: As of Firefox 9, this really means what it's meant to do on all platforms, ie. instances created using this parameter do not accept or send remote teams, see bug 650078 . This means that such instances cannot be reused. Also when using this argument anyway. a new instance is created.

-migration

Launching the application with the Migration Wizard.

-override /path/to/ override.ini

Loads the specified override.ini file to override application.ini(). This can be used to suppress the Migration Wizard at startup by loading the following override.ini file. Only Firefox.

EnableProfileMigrator=0

Browser

-browser

Launching the browser component. Only Firefox And seamonkey.

-url URL

Opens the URL in a new window or tab, depending on the browser settings. The option name -url can be omitted. Multiple URLs are allowed, separated by spaces. Only Firefox And seamonkey.

Note: When you open multiple URLs, Firefox always opens them as tabs in a new window.

Firefox www.mozilla.com firefox www.mozilla.com website

-private

Opens Firefox in private browsing mode. Only Firefox 3.6 and later.

Not applicable in Ubuntu for Firefox 20 and later.

-private-window

Opens a new private window of an existing Firefox instance. Only Firefox 20 and later.

-private-window URL

Opens URL in a new window in privacy mode. If a private window is already open, a new tab will be opened in the existing window.Only Firefox 29 and later. Doesn't work in Firefox 31 on linux mint 17 (the page opens in a non-private window).

-new-tab URL

Opens the URL in a new tab. Only Firefox And SeaMonkey2.x.

-new-window URL

Opens the URL in a new window. Only Firefox And SeaMonkey2.x.

-search term

Search for term in the default search engine. Only Firefox And Sea Monkey 2.1 and later.

-preferences

Opens the settings window. Only Firefox And SeaMonkey2.x.

-setDefaultBrowser

Sets the application as the default browser. Only Firefox.

Mail and news

-mail

Starts the mail client. Only Thunderbird And seamonkey.

-news news_URL

Launches the news client. If news_URL is specified (optional), opens the specified newsgroup. Only Thunderbird And seamonkey.

Thunderbird -news news://server/group

-compose message_options

Opens the mail editor. Cm. . Only Thunderbird And seamonkey.

Thunderbird -compose" [email protected] "

-address book

Opens the address book. Only Thunderbird And seamonkey.

-options

Opens the "Tools/Settings" window. Only Thunderbird.

-offline

Run in mode battery life. Only Thunderbird And seamonkey.

-setDefaultMail

Sets the application as the default email client. Only Thunderbird.

Calendar

-calendar

Launches the calendar application. Only Sunbird.

-subscribe URL or -url URL

-show date date

Show your schedule for the specified date date . Only Sunbird.

Sunbird -showdate 08/04/2008

Other components

-editor URL or -edit URL

Launches the editor for the specified URL (where URL is an optional parameter). Only seamonkey.

Seamonkey -edit www.mozilla.org

-jsdebugger

-start-debugger-server port

-inspector URL

firefox-chrome chrome://inspector/content

-register chrome_URL

Registers the specified chrome but does not start the application.

Add-ons

Note on Gecko 1.9.2

The options -install-global-extension and -install-global-theme have been removed from Gecko 1.9.2 and later.

-install-global-extension /path/to/extension

Installs an extension to the application folder. The path to the extension is specified as a parameter. You must have administrator rights to install.

-install-global-theme /path/to/theme

Same as above for topics. You must have administrator rights to install.

Note: Since Firefox 2.0.0.7, the use of the -install-global-extension and -install-global-theme command line options has been limited to installing only those extensions that are on the local or network drive. Installation directly from a network share is no longer allowed.

-safe mode

Launches an application with add-ons disabled for this session only. (Extensions do not load, but are not permanently disabled in the extension manager).

Localization

-UILocale locale

Run with the UI language specified in locale .

Firefox -UILocale en-US

Remote control

-remote remote_command

Note: This feature was removed in Firefox 36.0, restored in 36.0.1, and removed again in version 39.0. See bug 1080319 .

Executes a remote_command in an already running application process (see remote control).

Firefox -remote "openURL(www.mozilla.org, new-tab)"

Note: This option is only available for UNIX platforms running X-Windows.

Miscellaneous

-tray

Launching the application minimized to tray. Useful for startup.

-silent

Do not open windows by default. Useful when used with options that open their own windows, but do not prevent default windows from opening. Only Firefox, Thunderbird3.x And SeaMonkey2.x.

-console

Launching the application with the debug console.

Note: Supported for Windows only.

-attach-console

Write messages to the debug console of the window that launched the application, instead of opening a new window for debug messages.

Original: Command-line programs for everyday use in Linux
Author: Rares Aioanei
Publication date: January 31, 2012
Translation: A. Krivoshey
Transfer date: May 2012

1. Introduction

I must admit that I am a command line fanatic. If it's possible, regardless of the desktop environment and distribution I'm using, I open up a terminal and start doing all sorts of nonsense. Of course, this does not mean that everyone should follow me. Most people prefer to use a mouse and a GUI. However, there are many situations where it is easier to complete a task using the command line. And sometimes, for example, when updating the kernel or video card driver, the graphics mode can simply turn off due to some kind of bug in new version. In the meantime, for example, you need to urgently send a very important letter... All the basic operations performed in graphical mode (of course, with some exceptions) can be performed just as easily on a machine running in the console. If you are interested in this topic, welcome.

2. Tasks

First, let's define what we mean by everyday tasks. It could be email, watching something interesting on YouTube (yes, it's possible), chatting, or just surfing the web. We will talk about all these tasks in our article. By the way, another advantage of working in the command line (besides being efficient and undemanding to system resources) is uniformity. Working on any computer with Linux installed, you don't have to worry about not having your favorite graphical environment installed on it - the programs we're going to talk about will look the same regardless of the presence of a graphical interface. It should be noted that in this article we will talk about the basic concepts and principles of using programs, it is not a step-by-step guide to using them.

2.1. Web surfing

Of course, you won't be able to view images, but console browsers will be very fast, much faster than any graphical counterpart. In addition, the security will also be on top, because some of them do not even support Javascript, unless you compile them with specially given options. Let me introduce links, elinks and lynx. In almost all distributions, they can be installed using the standard package management system, or you can build them yourself from source code, which is not a big problem since they have few dependencies. links also has a command line flag (-g) which, if links has been compiled with the right options, produces a simple but fast graphical browser.

On Debian, when I tried to launch the browser using the "links -g" command, I got the message "Graphics not enabled when compiling (use links2 instead for graphics mode)". By installing links2 and entering the command

I got what I wanted. If I need to go to a site in a text browser that uses Javascript for authorization, I use elinks. Nowadays, with the development of the market mobile devices many sites have special mobile versions(and Gmail has an HTML version that's great for this) that can be viewed in text browsers, unless you need images or flash. Another advantage of console browsers is the significantly lower traffic consumption. If you want the most minimalistic and fastest option, we advise you to pay attention to lynx. This is the smallest and fastest browser, even in comparison with its analogue.
Above, I mentioned watching youtube videos on the command line. You can download them using the youtube-dl utility, and then, after a short study of the mplayer options, view them.

2.2. Chat

Majority Linux users Pidgin uses Pidgin for this purpose, as it supports a large number of protocols, history (does anyone else remember Gaim?) and has a beautiful interface. What many don't know is that the Pidgin development team offers a command-line equivalent called Finch. It can be installed on most distributions without problems, but be warned that unlike most command line programs, Finch has a lot of dependencies because it is bundled with Pidgin, which in turn requires a lot of them. Finch supports all protocols that Pidgin supports. The only difference is in the interface.
When it comes to communication, the Linux community prefers IRC. While Finch already supports IRC, I'd like to introduce an IRC-only client called irssi. It is very easy to use, but do not underestimate its capabilities. irssi allows you to write scripts and supports all the advanced IRC features you might need. When you first start the program creates a configuration file in ~/.irssi/, which can be edited if necessary. It is easy enough to master, as this file already contains a large number of examples of ready-made configurations. I prefer to use irssi directly from the command line:

$irssi -c $host -n $nick

2.3. Multimedia

Who said you need an X server to listen to music? Of course, this is not the case, and there are many applications besides mplayer, which we already talked about, that allow you to do this. Of course I haven't worked with everyone, usually I use mp3blaster. It supports mp3 and ogg, playlists, id3 and has a beautiful and user friendly interface.

It is available in Debian, and is also available in Ubuntu, Mint and their derivatives. OpenSUSE users who have the Packman repository enabled can also install mp3blaster. It doesn't seem to be available in new releases of Fedora, so you'll have to compile it yourself (or build a package).

2.4. News

When I say news, I mean two things: RSS and NNTP, that is, Usenet. Of course, on Linux there is no problem using them, but when it comes to RSS, the same question arises: images. Again, it all depends on the type of news you read. If it's comics, for example, then it's bad. In any case, consider these programs, keeping in mind that they are by no means the only alternative available. I just use them, that's why I write about them.
For RSS I use Snownews, a really small and fast reader. On the project website you can see how the program will look like, since it is almost an exact copy of its interface. Unfortunately I can't please Debian users as the program (as a package) is only available for Lenny. Packages are available for Fedora, Gentoo, BSD and Solaris. What I like about Snownews is that it's really fast, even though XML parsing is quite a challenge.
When it comes to reading Usenet, every Linux veteran should know about Tin, the Threaded Internet News reader. I hope I didn't misrepresent the acronym, correct me if I'm wrong. It has a rich history, is fast and easy to set up, is distributed under a liberal (BSD) license, and is available on almost all Unix-based systems such as BSD, Solaris, and even OpenVMS. I use it for reading news remotely, so I run it with the -r flag because otherwise tin will try to use a local buffer that doesn't exist on my machine. Below I give an example of my settings for Tin.

//edit ~/.newsrc and enter the groups you want to subscribe to, one per line //if you already have such a file, replace the trailing "!" with a semicolon //for the groups you want to subscribe to $ export NNTPSERVER=$server $ tin -Q

3. Conclusion

Research shows that, despite all the efforts to develop graphical interfaces, people are most efficient at the command line. Can't tell if this is true or not. What I can really say is that I myself actually work more productively on the command line, despite the time consuming training in such work. And what do you think about this?

More than one generation of those Internet users has already grown up who did not catch the beginning of the rapid rise of Microsoft Corporation and do not even know how to open the command line.

This early version of the Windows operating system, called MS DOS, featured single-tasking (all processes ran sequentially, not in parallel) and a predominantly text-based interface.

Now most of the operations on the computer under Windows control can be performed exclusively with the mouse, and in those days, even for the simplest actions, it was necessary to know many complex text commands.

Through a shortcut in the start menu

Running the Run program to open a command prompt is a strange idea, since the required shortcut is right next door.

It can also be quickly found through the Start menu search.

Due to a significant change in the Start menu interface in Windows 8, this method will be implemented slightly differently.

  • First you need to go to the tiles with applications (new version of Start) and right-click on a free area. As a result, a panel will pop up at the bottom, giving advanced features.
    In it, you need to click on the icon All applications in the lower right corner.

  • Here you will see a list with additional hidden applications, including the Command Prompt shortcut. Now you need to click on the desired shortcut with the right mouse button and select the option to run as administrator in the bottom panel.

Advice! Running with administrator rights is recommended because some commands simply will not run normally.

In Windows 10, search works throughout the system. Therefore, to quickly find the command line, you need to press the combination Win + S and enter the name of the program, in this case it is the command line.

Search for an executable file on the system drive

As mentioned above, the command line is implemented through a small executable cmd.exe.

From here we can make a logical conclusion that this executable can be found in some folder and run directly.

This is true, the command line executable starting from the seven is stored in the System32 subdirectory Windows folder.

Hidden menu in Windows 8 and Windows 10

In the last two versions of the world's most popular operating system, there is a combination of hot keys to open a special menu for experienced users, which contains all the most necessary system utilities.

It is opened by pressing the Win + X keys, and it just found a place for the command line.

Through the context menu in Windows 10 Explorer

Ten has its own unique way to call the command line. It consists in calling this function through Windows Explorer.

To do this, you need to open any folder and, while holding down the Shift key, right-click in any free area of ​​\u200b\u200bthis folder.

As a result, an extended context menu will open, in which there will be an option to call the command line.

As you can see from the methods in this article, the command line in operating systems Windows can be invoked in a variety of ways.

This seems to be for such a small program of several hundred kilobytes and with unclear functionality.

But such a misunderstanding can only occur among inexperienced users.

Those people who have been actively using a computer for work and entertainment for more than a year understand perfectly well that cmd.exe is a powerful tool that can instantly produce results if you know how to handle it.

That is why the most latest versions Windows, focused on cross-platform (and primarily on compatibility with devices that have a touchscreen), not only did not lose this function, but also acquired additional features for comfortable working with it.

How to open a command prompt in Windows

This video shows several ways to open the command line in windows system 7. In windows XP, vista command line opens the same way.

There are situations when you need to open a browser with a certain set of options, for example: open a specific address in InPrivate mode, launch the browser with add-ons disabled, disable automatic tab recovery when it crashes, etc. Of course, all these operations can be called using the graphical interface of the program, but from the point of view of process optimization, it is better to use the command line. Why, for example, launch the browser in InPrivate mode every time, then enter the address of the payment system, if all this can be done with one click!?

Supported command line options

Table 1 - Supported command line options with a brief description.

-embeddingRunning Internet Explorer 9 using OLE (Object Linking and Embedding) technology.
-extoffSupported starting with Internet Explorer 7. Launches the browser, completely disabling all add-ons (only for the current session, i.e., when restarting, add-ons will be automatically enabled).
-frame mergingSupported since Internet Explorer 8. Allows the browser to use frame based tag merging. It is not recommended for use by users who are used to browsing websites in several sessions, for example, logging into several mail accounts at the same time.
-kLaunches the browser in Kiosk mode. At the same time, there are no visual controls, and the browser itself expands to full screen. are still working.
-noframemergingSupported starting with Internet Explorer 8. Prevents the browser from using the frame merging feature.
-nohangrecoverySupported starting with Internet Explorer 9. Disables the reloading of a frozen web page. Used primarily by developers to debug add-ons, elements ActiveX controls etc.
-privateSupported starting with Internet Explorer 8. Launches the browser in InPrivate mode.
URL addressWhen launched, the browser will open the typed address for you. If you enter 2 or more parameters, the browser will redirect you to the search page for this expression.

Command Line Examples in Internet Explorer 9

Since many people do not use the command line, I will give examples of using commands on desktop shortcuts. Right-click on an empty space on the desktop. Choose Create - Shortcut. IN Property location enter the command from the example.

Simultaneous login to the site with two different accounts

If there is a need to work simultaneously in two mailboxes of the same mail service, we use the parameter to start -noframemerging:

"C:\Program Files\Internet Explorer\iexplore.exe" -noframemerging

Now you need to launch two copies of the browser, and then in both go to different mailboxes of the same mail service (for example, I used gmail.com). Moreover, if you log out of one account, the second one will continue to work (which is not available with the normal launch of two copies of Internet Explorer 9).

Figure 1 - Working with two gmail accounts at the same time using the -noframemerging option.

privacy mode

Create a shortcut to work with payment system(in this case, PayPal), in InPrivate mode:

"C:\Program Files\Internet Explorer\iexplore.exe" -private paypal.com

Figure 2 - Browser launched with the -private option.

Kiosk Mode

Let's say you need to run Internet Explorer in full screen while opening a specific site (in our case, the site). Team:

"C:\Program Files\Internet Explorer\iexplore.exe" -k site

Figure 3 - Internet Explorer running in kiosk mode.

Debug mode

For debugging, a web developer needs to launch the browser without all the add-ons, as well as disabling the automatic tab recovery system. We use the following command:

"C:\Program Files\Internet Explorer\iexplore.exe" -extoff -nohangrecovery

Figure 4 - Launching a browser with the -extoff option is accompanied by this warning page (always, except when used with -private).

The command line is still a powerful Windows tool used by OS users and supported by many applications. Internet browser Explorer 9 is no exception - working with the command line is simple and intuitive, and the semantics of the commands clearly reflect the function that it (the command) implements. Don't forget about this toolkit to empower your browser and automate everyday tasks.

mob_info