How to open Salesforce org with one click?

Photo by Bram Naus on Unsplash

How to open Salesforce org with one click?

Opening a Salesforce org requires multiple clicks but there is a way to open and login into the org with a single click.

It requires Salesforce CLI installed on the local machine. If you don't have one, can install it from this link.

Once you had Salesforce CLI on your local machine, Follow below steps :

  1. Open Command Prompt and run the below code:

    sfdx auth:web:login -r https://login.salesforce.com -a <alias>

    Here <alias> is a nickname or simple name of your org. It can be anything. For example,

    sfdx auth:web:login -rhttps://login.salesforce.com -a creativefox

    If you want to open sandbox or scratch org, then replace the command as below :

    sfdx auth:web:login -r https://test.salesforce.com -a <alias>

  2. Once you run the command, it will open the login page there you need to login with your org credentials.

  3. Now open the Notepad and enter the below command:

    sfdx force:org:open -u <alias>

    replace the <alias> with the name you have given previously. It may look like this sfdx force:org:open -u creativefox .

  4. Save the file with any name but replace the .txt with .bat (batch file). Then create a shortcut and place it on the Desktop. That's it.

  5. Now, you need to just double-click the shortcut. It will automatically log you in and opens the org. It works even after you shut down your machine.

Thanks for reading.