Command Line Arguments
If you specify a file path, the file will be uploaded. Providing a URL causes ShareX to download the content and then upload it. Multiple paths can be used to upload several files simultaneously.
This option enables the execution of multiple ShareX instances. By default, the application is restricted to a single running instance.
Invokes ShareX in portable mode. When operating in this mode, the program will create a subfolder named "ShareX" within its starting directory (if it doesn't already exist) to store all configuration files and images.
Launches ShareX directly to the system tray without displaying its main window. This functionality is only available if the "Show tray icon" setting is enabled.
ShareX will launch with its default configuration and will not save any settings files (such as ApplicationConfig.json, HotkeysConfig.json, UploadersConfig.json, or History.xml) to disk.
Any hotkey action can be utilized as a command-line argument.
Examples: -RectangleRegion, -PrintScreen, -ClipboardUpload, and -ScreenColorPicker.
A complete list of hotkey actions is available inpublic enum HotkeyType here.
These specific actions also support additional parameters:
-FileUpload "file path"-PinToScreen "image file path"-PinToScreenFromFile "image file path"-ImageEditor "image file path"-ImageBeautifier "image file path"-ImageEffects "image file path"-ImageViewer "image file path"-VideoConverter "video file path"-OCR "image file path"-QRCode "image file path"-HashCheck "file path"-Metadata "file path"-StripMetadata "file path"Your workflows (hotkey tasks) can be executed by their descriptions.
Example: -workflow "Capture rectangle region & annotate"
This will run your custom hotkey that matches the provided description.
This command must accompany a file or URL path. The task settings will be applied during the upload. Only the initial matching task command is processed; subsequent ones are disregarded. The placement of the task command does not matter.
Example: "C:\\ShareX.png" -task "Upload to Imgur"
Once all tasks are finished, ShareX will shut down automatically.
For instance, you could use it to upload two images simultaneously, then have ShareX close after both uploads are done.
Prevents the hotkey registration error window from appearing if registration fails on startup.
The specified .sxcu file path is used for adding a custom uploader configuration to ShareX..sxcuIt also serves for file association.
This .sxie file path is used to integrate an image effect configuration into ShareX..sxieIt is additionally utilized for file association.
When in silent mode, the wizard and background window are not visible, but the installation progress window is displayed.
In very silent mode, the installation progress window is also hidden from view.
ShareX will not launch automatically once setup has concluded.
This command stops the setup from re-applying initial tasks, such as creating a desktop shortcut or context menu entries. It is used when updating ShareX.
These registry settings must be located in either theHKEY_LOCAL_MACHINE\SOFTWARE\ShareX key or the HKEY_CURRENT_USER\SOFTWARE\ShareX key. HKEY_LOCAL_MACHINEtakes precedence overHKEY_CURRENT_USERwhen settings are being read.
REG_DWORDTurns off checks for updates.
REG_DWORDDisables uploads across the entire application.
REG_DWORDPrevents the saving of debug log files.
REG_SZChanges ShareX's default personal path, which is by default the%UserProfile%\Documents\ShareX folder.
You can add custom actions to the Windows context menu by utilizing ShareX command-line arguments.
ShareX adds options like "Upload with ShareX" and "Edit with ShareX" to the Windows context menu via the registry. You can similarly modify the registry to incorporate other ShareX actions.
To illustrate, to integrate a "Pin to screen" entry specifically for image files, you would use the following registry files:
AddPinToScreen.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\ShareXPinToScreen]
@="Pin to screen"
"Icon"="\"C:\\Program Files\\ShareX\\ShareX.exe\",0"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\ShareXPinToScreen\command]
@="\"C:\\Program Files\\ShareX\\ShareX.exe\" -PinToScreen \"%1\""
RemovePinToScreen.reg
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\image\shell\ShareXPinToScreen]
ShareX determines the personal path using this ordered process:
-portable or -pIf a CLI flag is present, that path is used..\ShareX folder..\PortableIf the file exists, its path is utilized..\ShareX folder.PersonalPathA registry value, if found, dictates the path.%LocalAppData%\ShareX\PersonalPath.cfgIf it exists, the contents are moved to it.%UserProfile%\Documents\ShareX\PersonalPath.cfg..\PersonalPath.cfgIf it exists, the file path specified within it is used.%UserProfile%\Documents\ShareX\PersonalPath.cfgIf it exists, the file path specified within it is used.%UserProfile%\Documents\ShareX.For instance, the portable version of ShareX relies on step 2 in this sequence.