0

I am following the saleor docs and came across "$env:SECRET_KEY = "<mysecretkey>" I tried this in my windows 10 command prompt but it doesn't work and gives me the following error- The filename, directory name, or volume label syntax is incorrect.

so what's that command used for and why is it not working?

0

I tried this in my windows 10 command prompt but it doesn't work

The command you found in the tutorial was for PowerShell, not Command Prompt.

Windows 10 comes with two command interpreters: Cmd (the traditional "Command Prompt") and PowerShell. They have similar basic commands but very different syntax, with PowerShell trying to improve on Cmd's kludges dating from MS-DOS era. You'll find both in the Start Menu.

In Cmd (Command Prompt), you would set the same environment variable like this:

set SECRET_KEY=<mysecretkey>

or like this:

set "SECRET_KEY=<mysecretkey>"

Note: In Cmd, quoting just the value won't actually work the way you expect: the quotes will end up stored as part of the value. (You can see the result by running just set SECRET_KEY or set SECR.)

|improve this answer|||||
  • i am really feeling stupid that i didn't tried the command in powershell. i searched in google but couldn't find any reference to that powershell and cmd issue. Thanks a lot. – Almuntasir Abir Oct 26 '19 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.