function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
K VK V 

I am stuck at Salesforce DX lesson 3 create and test our scratch org. 'C:\Program' is not recognized as an internal or external command, operable program or batch file.

Raj VakatiRaj Vakati
what is the command you are using 
K VK V
Sfdx force:org:create -s -f config/project-scratch-def.json -a “default scratch org:
Raj VakatiRaj Vakati

use this command 
 
sfdx force:org:create -f project-scratch-def.json -a MyScratchOrg

 
K VK V
Thanks Raj! New error: No defaultdevhubusername org found.
Raj VakatiRaj Vakati
ok ..follow this steps 


1 . Login to Dev Hub from CLI 
 
sfdx force:auth:web:login --setdefaultdevhubusername --setalias my-sfdc-hub-org

 2. Create an SFDX Project
sfdx force:project:create --projectname DXLearning


 3. Create a Scratch Org for Development
sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername --setalias my-sfdc-scratch-org

4.Open scratch Org
sfdx force:org:open
https://rajvakati.com/2018/03/21/salesforce-dx-absolute-beginner-part-3-of-7/
 
K VK V
Not sure if it worked? I followed your steps. It didn’t return anything on each command.
Raj VakatiRaj Vakati
Are your running this from the command prompt?
Raj VakatiRaj Vakati
https://rajvakati.com/2018/03/21/salesforce-dx-absolute-beginner-part-3-of-7/
 
K VK V
Yes from git
Raj VakatiRaj Vakati
When you run the following command, salesforce login page will be open to enter the Dev hub login details in the new browser window.

sfdx force:auth:web:login --setdefaultdevhubusername --setalias my-sfdc-hub-org


User-added image

After Successful login into the Dev Hub, you can see the success message into the CLI . Please share the screen shot 
Daniel RobertsDaniel Roberts
I have also discovered that this is inconsistent with GitBash. I was running into the same issue on the Get Ready to Create an App Unit in the Salesforce DX series. I tried multiple things to get this to pull the accounts in with the SOQL query, but it kept giving me the same error. 

ONce I switched to the standard CLI, I had a lot more consistency. 
J DeveloperJ Developer
@Daniel Roberts 14 - thanks for this comment.  I had the same problem.  Opening the windows CMD window and running the exact same code that was failing in the GitBash shell worked.

This is the force command that was not running in GitBash 

sfdx force:data:tree:export -q "SELECT Name, Location__Latitude__s, Location__Longitude__s FROM Account WHERE Location__Latitude__s != NULL AND Location__Longitude__s != NULL" -d ./data
Charly BGoodCharly BGood
Yeah, I came to say that it must be a problem with GIT because I did what @Daniel Roberts suggested, (closed git and did it on cmd-entering on the same directory of course-) and it worked!! Thanks !!  Kinda sad 'cause GIT feels much more fast and comfort, but alright !!!