ShareX

Comand line arguments

ShareX CLI

“File or URL path”

The “File or URL path” option in ShareX processes either a file path for direct upload or a URL for download followed by upload. Multiple paths can be provided to upload multiple files simultaneously.

-multi or -m

By utilizing the ‘-multi’ or ‘-m’ option, ShareX gains the capability to open multiple instances, a feature not available by default, as ShareX typically restricts users to a single instance.

-portable or -p

When initiated with the ‘-portable’ or ‘-p’ option, ShareX launches in portable mode. In this mode, the application establishes a “ShareX” folder in its startup path, facilitating the storage of configuration files and images. If the folder doesn’t exist, ShareX creates it automatically.

-silent or -s

When invoked with the ‘-silent’ or ‘-s’ option, ShareX is discreetly loaded into the system tray, bypassing the display of the main window. However, this behavior occurs only if the “Show tray icon” setting is enabled in ShareX’s configuration.

-sandbox

With the ‘-sandbox’ option, ShareX launches using default settings, and it refrains from saving any configuration data, including files such as ApplicationConfig.json, HotkeysConfig.json, UploadersConfig.json, and History.xml, onto the hard disk.

Using hotkey actions

Any hotkey action can be utilized as a command line argument in ShareX. For instance, options like ‘-RectangleRegion’, ‘-PrintScreen’, ‘-ClipboardUpload’, ‘-ScreenColorPicker’, among others, are available for use. A comprehensive list of hotkey actions can be accessed from the public enum HotkeyType.

-imageeditor “image file path”

The ‘-imageeditor’ option in ShareX allows you to open the ShareX image editor with a specified image file.

-imageeffects “image file path”

Utilize the ‘-imageeffects’ option in ShareX to open the image effects window with a specified image file.

-workflow “Hotkey description”

You can execute your custom workflows (hotkey tasks) in ShareX by using their descriptions. For example, using the ‘-workflow’ option followed by the description, such as “Capture rectangle region & annotate”, will trigger the corresponding custom hotkey.

-task “Hotkey description”

The ‘-task’ command in ShareX must be coupled with a file or URL path. It specifies a task setting for upload, where only the first matched task command is utilized, with subsequent ones being ignored. The position of the task command is irrelevant. For instance, “C:\ShareX.png” -task “Upload to Imgur” instructs ShareX to upload the specified file to Imgur using the configured task setting.

autoclose

ShareX can automatically close after completing all tasks. For example, you can upload two images simultaneously and then instruct ShareX to close once all uploads are finished.

-nohotkeys

During ShareX startup, if hotkey registration fails, the application can be configured not to display the hotkey registration error window.

-customuploader “.sxcu file path”

The ‘.sxcu’ file path is specified to incorporate custom uploader configurations into ShareX. Additionally, it serves for association with ‘.sxcu’ files.

-imageeffect “.sxie file path”

The specified ‘.sxie’ file path is utilized to integrate image effect configurations into ShareX. Furthermore, it facilitates association with ‘.sxie’ files.

ShareX setup CLI

When setup operates silently, it hides the wizard and background window, while still displaying the installation progress window.

/VERYSILENT

In extremely silent setup modes, even the installation progress window is not displayed.

/NORUN

ShareX does not run automatically after the setup is complete.

/UPDATE

This command prevents the setup from reapplying initial tasks like creating desktop shortcuts or context menu entries. It’s typically used during ShareX updates.

Registry

The registry settings should be located within either the HKEY_LOCAL_MACHINE\SOFTWARE\ShareX key or the HKEY_CURRENT_USER\SOFTWARE\ShareX key. When reading the settings, HKEY_LOCAL_MACHINE takes precedence over HKEY_CURRENT_USER.

DisableUpdateCheck REG_DWORD

Disables update checks.

DisableUpload REG_DWORD

Disables uploads application wide.

DisableLogging REG_DWORD

Disables debug log file saving.

PersonalPath REG_SZ

Overrides personal path of ShareX, which is by default %UserProfile%\Documents\ShareX folder.

Personal path

This is how ShareX decides about personal path in this order:

If the -portable or -p CLI flag is present, the program will use the .ShareX folder. If an empty .Portable file exists, the .ShareX folder will be utilized. Alternatively, if the PersonalPath value exists in the registry, it will be employed. If %LocalAppData%\ShareX\PersonalPath.cfg file exists, it will be moved to %UserProfile%\Documents\ShareX\PersonalPath.cfg. If a .PersonalPath.cfg file exists, the file path within it will be used. Otherwise, if %UserProfile%\Documents\ShareX\PersonalPath.cfg file exists, its file path will be utilized. If none of the above conditions are met, the default personal path %UserProfile%\Documents\ShareX will be used. For instance, a portable build of ShareX follows the second step outlined here.