Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.

Difference between revisions of "Glossary:Command line arguments"

From PCGamingWiki, the wiki about fixing PC games
m (misc. fixes)
(30 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{++}} Commonly used to force [[Glossary:Borderless fullscreen windowed|windowed modes]], custom specific resolutions or force certain hidden settings.
+
'''Key points'''
 +
{{ii}} Commonly used to force [[Glossary:Borderless fullscreen windowed|windowed modes]], custom specific resolutions or certain hidden settings.
 +
 
 +
'''General information'''
 +
{{mm}} [[Wikipedia:Command-line interface#Arguments|Command-line argument]] at Wikipedia
 +
 
 +
A '''command line argument/parameter/option''' is additional data provided to an application at launch that might affect how the application behaves. They usually follow at the end of a launch command, after the name of the executable being run. For example, while many Windows users might be familiar with <code>ipconfig /all</code> or <code>ping google.com</code> for network diagnostics, those "commands" are made up of the application to run as well as the appropriate command-line argument to affect how the application runs. The full launch command used behind-the-scene in those examples are in reality:
 +
 
 +
"C:\Windows\System32\ipconfig.exe" /all
 +
"C:\Windows\System32\PING.EXE" google.com
 +
 
 +
Many games and software exposes certain parameters and options for command-line use to allow developers or users to configure the application in a certain way directly at launch, without requiring what might otherwise be rather cumbersome ways to do the same thing. This is often used to enable or configure settings not exposed through the built-in configuration menu of the application, or to load specific configurations (such as benchmark runs, listening servers, etc). While many command line arguments might be the same across multiple games, these are often the result of using the same engine or similar internal naming schemes among separate developers.
 +
 
 +
An application only supports the command line arguments it have been developed to support, and ignores those it does not recognize how to handle. Supported command line arguments must either be revealed by the developer or found by users by [[Wikipedia:Data mining|data mining]] the application. One such way of finding supported command lines involves using [https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer Process Explorer] to extract all found strings of the executable and then going through those to find and test what might be applicable as an argument, parameter, or option.
 +
 
 +
Command line arguments often supported by games includes:
 +
* <code>-fullscreen</code>, <code>-windowed</code>, or a variation thereof to specify display mode to use.
 +
* <code>-resolution</code>, <code>-width</code> or <code>-height</code> to specify resolution to use.
 +
* <code>-console</code> to enable the built-in console if the application have one.
  
 
==Windows==
 
==Windows==
 +
{{ii}} Follow the instructions for the desired environment.
 
===Desktop shortcuts===
 
===Desktop shortcuts===
[[File:Desktop Shortcut Example.png|160px|right]]
+
{{Image|Desktop Shortcut Example.png|Desktop shortcut}}
 
{{ii}} For generic Windows desktop shortcuts.
 
{{ii}} For generic Windows desktop shortcuts.
{{Fixbox|1=
+
 
{{Fixbox/fix|Instructions|}}
+
{{Fixbox|description=Instructions|ref=<ref>[https://www.techwalla.com/articles/how-to-add-a-command-line-parameter-to-a-windows-shortcut How to Add a Command Line Parameter to a Windows Shortcut]</ref>|fix=
 
# Create a new shortcut, then {{key|Right Click}} on the shortcut and choose '''Properties'''.
 
# Create a new shortcut, then {{key|Right Click}} on the shortcut and choose '''Properties'''.
 
# Under the '''Shortcut''' tab, find the '''Target''' field.  
 
# Under the '''Shortcut''' tab, find the '''Target''' field.  
Line 16: Line 35:
  
 
'''Notes'''
 
'''Notes'''
 +
{{ii}} Use the '''Arrow Keys''' or {{key|End}} to get the cursor at the end of the path.
 
{{ii}} Push {{key|Space}} if more spaces are required, right after the quotes.
 
{{ii}} Push {{key|Space}} if more spaces are required, right after the quotes.
 
}}
 
}}
  
===Steam===
+
===Battle.net===
[[File:Steam Shortcut Example.png|160px|right]]
+
{{Image|Battle.net command line.png|Battle.net}}
{{Fixbox|1=
+
{{Fixbox|description=Instructions|ref=<ref name="Dr4 ref" />|fix=
{{Fixbox/fix|Instructions|}}
+
# Open '''Games''' tab on the top-left menu, then select a game by clicking on it.
# Open the '''Library''', then {{key|Right Click}} on the desired game and select '''Properties'''.
+
# Select '''Options''' on the menu below the game's title.
# Open '''Set Launch Options'''.
+
# Select '''Game Settings''' on the drop down menu.
# Write any arguments in the text field, then click '''OK'''.
+
# Tick the '''Additional command line arguments''' radio button.
 +
# Write any arguments in the text field, then click '''Done''' button at the bottom of the page.
 +
}}
 +
 
 +
===Epic Games Store===
 +
{{Image|Epic Games Store command line.png|Epic Games Store}}
 +
{{Fixbox|description=Instructions|ref=|fix=
 +
# Open the '''Launcher'''.
 +
# Click on '''Settings''' on the bottom-left side.
 +
# Scroll down to the bottom and select the desired game.
 +
# Tick the '''Additional Command Line Arguments''' box.
 +
# Write any arguments in the text box.
 
}}
 
}}
  
===Custom Steam shortcuts===
+
===GOG Galaxy===
[[File:Non Steam Shortcut Example.png|160px|right]]
+
{{Image|GOG Galaxy command line.png|GOG Galaxy}}
{{ii}} Command lines arguments for games added through the '''Add a Non-Steam Game to My Library''' option.
+
{{Fixbox|description=Instructions|ref=<ref>{{Refcheck|user=Orzelek303|date=2018-02-01|comment=}}</ref>|fix=
{{Fixbox|1=
+
# {{key|Right Click}} on the game's title and select '''Settings'''.
{{Fixbox/fix|Instructions|}}
+
# Fill the checkbox next to '''Add command line arguments'''.
# Open the '''Library''', then {{key|Right Click}} on the desired game and select '''Properties'''.
+
# Write any arguments in the text box.
# Write any arguments after the quotes, then click '''Close'''.
+
}}
  
<pre>
+
===GOG Galaxy 2.0===
"<path-to-game>\game.exe" -command
+
{{Fixbox|description=Instructions|ref=<ref>{{Refcheck|user=Suicide machine|date=2020-04-30}}</ref>|fix=
</pre>
+
# {{key|Right Click}} on installed game in your GOG Library.
 +
# Select '''Manage installation''' -> '''Configure'''.
 +
# Under features tab enable '''Custom executables / arguments'''.
 +
# Duplicate the entry that leads to game's executable that you want to apply custom command-line arguments for (in most cases File 1) or Add another executable.
 +
# Scroll down to a new position and provide custom arguments in '''Arguments''' field.
 +
# Modify '''My label''' field if needed to more easily differentiate it.
 +
# Check '''Default executable''' field, if you want this position to be used when launching the game from GOG Galaxy (alternatively, it can be launched manually by Right Clicking on the game in library and choosing it from Additional Executables.
 
}}
 
}}
  
 
===Origin===
 
===Origin===
[[File:Origin Game Properties Example.png|160px|right]]
+
{{Image|Origin command line.png|Origin}}
{{Fixbox|1=
+
{{Fixbox|description=Instructions|ref=<ref>{{Refcheck|user=Blackbird|date=2016-11-02|comment=}}</ref>|fix=
{{Fixbox/fix|Instructions|}}
 
 
# Open the '''Library''', then {{key|Right Click}} on the game's box art and select '''Game Properties'''.
 
# Open the '''Library''', then {{key|Right Click}} on the game's box art and select '''Game Properties'''.
# Write any arguments in the field box, then click '''Apply'''.
+
# Select '''Advanced Launch Options'''.
 +
# Write any arguments in the field box, then click '''Save'''.
 +
}}
 +
 
 +
===Steam===
 +
{{Image|Steam command line.png|Steam}}
 +
{{Fixbox|description=Instructions|ref=<ref>{{Refcheck|user=Hawaii_Beach|date=2017-01-09|comment=}}</ref>|fix=
 +
# Open the '''Library''', then {{key|Right Click}} on the desired game and select '''Properties'''.
 +
# Click on the '''Set Launch Options''' button located at the bottom.
 +
# Write any arguments in the text field, then click '''OK'''.
 +
}}
 +
 
 +
===Uplay===
 +
{{Image|Uplay command line.png|Uplay}}
 +
{{Fixbox|description=Instructions|ref=<ref name="Dr4 ref">{{Refcheck|user=Dr4Wm4N|date=2016-12-15|comment=}}</ref>|fix=
 +
# Open '''Games''' tab on the top-left menu, then select a game by clicking on it.
 +
# Select '''Properties''' on the menu below '''Play''' button.
 +
# Click on '''Add launch arguments''' button at the bottom of the page.
 +
# Write any arguments in the text field, then click '''Save''' button.
 
}}
 
}}
 +
 +
{{References}}
  
 
[[Category:Guide]]
 
[[Category:Guide]]

Revision as of 09:26, 1 August 2020

Key points

Commonly used to force windowed modes, custom specific resolutions or certain hidden settings.

General information

Command-line argument at Wikipedia

A command line argument/parameter/option is additional data provided to an application at launch that might affect how the application behaves. They usually follow at the end of a launch command, after the name of the executable being run. For example, while many Windows users might be familiar with ipconfig /all or ping google.com for network diagnostics, those "commands" are made up of the application to run as well as the appropriate command-line argument to affect how the application runs. The full launch command used behind-the-scene in those examples are in reality:

"C:\Windows\System32\ipconfig.exe" /all
"C:\Windows\System32\PING.EXE" google.com

Many games and software exposes certain parameters and options for command-line use to allow developers or users to configure the application in a certain way directly at launch, without requiring what might otherwise be rather cumbersome ways to do the same thing. This is often used to enable or configure settings not exposed through the built-in configuration menu of the application, or to load specific configurations (such as benchmark runs, listening servers, etc). While many command line arguments might be the same across multiple games, these are often the result of using the same engine or similar internal naming schemes among separate developers.

An application only supports the command line arguments it have been developed to support, and ignores those it does not recognize how to handle. Supported command line arguments must either be revealed by the developer or found by users by data mining the application. One such way of finding supported command lines involves using Process Explorer to extract all found strings of the executable and then going through those to find and test what might be applicable as an argument, parameter, or option.

Command line arguments often supported by games includes:

  • -fullscreen, -windowed, or a variation thereof to specify display mode to use.
  • -resolution, -width or -height to specify resolution to use.
  • -console to enable the built-in console if the application have one.

Windows

Follow the instructions for the desired environment.

Desktop shortcuts

Desktop shortcut
Desktop shortcut
For generic Windows desktop shortcuts.
Instructions[1]
  1. Create a new shortcut, then Right Click on the shortcut and choose Properties.
  2. Under the Shortcut tab, find the Target field.
  3. Write any arguments after the quotes, then click OK.
"<path-to-game>\game.exe" -command

Notes

Use the Arrow Keys or End to get the cursor at the end of the path.
Push Space if more spaces are required, right after the quotes.

Battle.net

Battle.net
Battle.net
Instructions[2]
  1. Open Games tab on the top-left menu, then select a game by clicking on it.
  2. Select Options on the menu below the game's title.
  3. Select Game Settings on the drop down menu.
  4. Tick the Additional command line arguments radio button.
  5. Write any arguments in the text field, then click Done button at the bottom of the page.

Epic Games Store

Epic Games Store
Epic Games Store
Instructions
  1. Open the Launcher.
  2. Click on Settings on the bottom-left side.
  3. Scroll down to the bottom and select the desired game.
  4. Tick the Additional Command Line Arguments box.
  5. Write any arguments in the text box.

GOG Galaxy

GOG Galaxy
GOG Galaxy
Instructions[3]
  1. Right Click on the game's title and select Settings.
  2. Fill the checkbox next to Add command line arguments.
  3. Write any arguments in the text box.

GOG Galaxy 2.0

Instructions[4]
  1. Right Click on installed game in your GOG Library.
  2. Select Manage installation -> Configure.
  3. Under features tab enable Custom executables / arguments.
  4. Duplicate the entry that leads to game's executable that you want to apply custom command-line arguments for (in most cases File 1) or Add another executable.
  5. Scroll down to a new position and provide custom arguments in Arguments field.
  6. Modify My label field if needed to more easily differentiate it.
  7. Check Default executable field, if you want this position to be used when launching the game from GOG Galaxy (alternatively, it can be launched manually by Right Clicking on the game in library and choosing it from Additional Executables.

Origin

Origin
Origin
Instructions[5]
  1. Open the Library, then Right Click on the game's box art and select Game Properties.
  2. Select Advanced Launch Options.
  3. Write any arguments in the field box, then click Save.

Steam

Steam
Steam
Instructions[6]
  1. Open the Library, then Right Click on the desired game and select Properties.
  2. Click on the Set Launch Options button located at the bottom.
  3. Write any arguments in the text field, then click OK.

Uplay

Uplay
Uplay
Instructions[2]
  1. Open Games tab on the top-left menu, then select a game by clicking on it.
  2. Select Properties on the menu below Play button.
  3. Click on Add launch arguments button at the bottom of the page.
  4. Write any arguments in the text field, then click Save button.


References

  1. How to Add a Command Line Parameter to a Windows Shortcut
  2. 2.0 2.1 Verified by User:Dr4Wm4N on 2016-12-15
  3. Verified by User:Orzelek303 on 2018-02-01
  4. Verified by User:Suicide machine on 2020-04-30
  5. Verified by User:Blackbird on 2016-11-02
  6. Verified by User:Hawaii_Beach on 2017-01-09