You may have heard of small hacks that work with Chrome; you can append a little ‘switch’ to a Chrome shortcut and change its behavior. We’ve covered one that allows you to launch Chrome in a particular profile and it’s pretty useful. Chrome isn’t the only app that supports these little ‘switches’, lots of apps do and these switches are actually command-line arguments that the apps support. These arguments are a great way to change the behavior of an app. If you have an app running on your desktop, and want to know if it’s running normally or with any of these switches, it’s fairly easy to find out.
Command-line arguments – Task Manager
This is the easiest method for viewing command-line arguments for a running app on Windows 10. Open Task Manager. Right-click the header of any one of the columns and select ‘Command line’ from the menu. This will add a new ‘Command line’ column. Look for your app in the Processes list, and check what the Command Line column displays for it. It will show you all the command-line arguments that were used when the app was launched.
Command-line arguments – Command Prompt
If the above method doesn’t work for a particular app, you can use a simple Command Prompt command to find all the switches that an app is running with but before you can use the command, you need a little information about the app.
Open Task Manager. Look for the app on the Processes tab and right-click it. Select ‘Go to details’ from the context menu. This will switch you over to the Details tab in Task Manager with the app highlighted. Note down the value in the PID column.
Open Command Prompt and run the following command. Replace the four zeros with the PID value for the app. The value can be much larger than four digits don’t worry about matching the length. The four zeros are just dummy values here.
wmic.exe path Win32_Process where handle='0000' get Commandline /format:list
wmic.exe path Win32_Process where handle='22792' get Commandline /format:list
The command will return all the switches for that particular process. Remember that some apps can run multiple instances and each instance will have its own PID. It’s up to you to track down the correct PID and use it for the command. You might get the command line arguments that a different instance is using if you aren’t careful.