Open your scratch org in one click! SFDX Scratch org login batch file

Hello,

This batch file opens your scratch org in one click. The whole purpose of this batch file is to reduce the effort of opening the command prompt & typing in the commands.

Steps:
1. Create a new file with .bat extension.
2. Copy the below code:

@echo off
echo WELCOME!

REM Below line is added to create a blank new line
echo.

REM Below line is written to add a delay of 2 secs
ping 127.0.0.1 -n 3 > nul
echo Below is the list of SFDX orgs

REM Below line fires sfdx command which shows you sfdx orgs
CALL sfdx force:org:list

echo Login initiated

REM Below line is written to add a delay of 4 secs
ping 127.0.0.1 -n 5 > nul

REM Below line is added to create a blank new line
echo.
echo Opening your scratch org !

REM Below line is added to open your scratch org. Please change the "[scratchorgalias]" by your scratch org's alias.
CALL sfdx force:org:open -u [scratchorgalias]

3. Save the file.

Now everytime you want to open your scratch org, use this file.

Comments

Post a Comment

Popular posts from this blog

SFDX Push Error : An object 'ComponentName' of type LightningComponentBundle was named in package.xml, but was not found in zipped directory

Salesforce Apex Triggers Interview Questions/Scenarios