How to run heroku pg:psql query in command line? [duplicate] - heroku

This question already has answers here:
Setting Windows PowerShell environment variables
(23 answers)
Powershell add to path, temporarily
(2 answers)
Error "'git' is not recognized as an internal or external command"
(21 answers)
'pip' is not recognized as an internal or external command
(39 answers)
'node' is not recognized as an internal or external command
(9 answers)
Closed 4 months ago.
This post was edited and submitted for review 4 months ago and failed to reopen the post:
Original close reason(s) were not resolved
After
heroku login
I'm trying to run in cmd:
echo "select * from public.table limit 2;" | heroku pg:psql -app "my-app::DATABASE_URL"
and get error: "The local psql command could not be located"
The local postgres installed in : C:\Program Files\PostgreSQL\14\bin
when I try to set path
set PATH=%PATH%;C:\Program Files\PostgreSQL\14\bin
or
setx PATH "PATH%;C:\Program Files\PostgreSQL\14\bin"
I get error like this:
C:\Program : The term 'C:\Program' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:17
+ set PATH=%PATH%;C:\Program Files\PostgreSQL\14\bin
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Program:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
How I can to run this ?

Related

How to run .sh script in Intellij in Windows

I have a problem about running sh file in Intellij in Windows.
When I clicked the run button in the file, I got this output shown below.
PS C:\Users\username\IdeaProjects\library> /bin/sh C:/Users/username/IdeaProjects/library/aws-setup.sh
/bin/sh : The term '/bin/sh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify t
hat the path is correct and try again.
At line:1 char:1
+ /bin/sh C:/Users/username/IdeaProjects/library/aws-setup.sh
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (/bin/sh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
How can I fix it?
Set Settings (Preferences on macOS) | Tools | Terminal | Shell path to c:\Program Files\Git\bin\bash.exe or use Shell Script run configuration with Interpreter path set to bash.exe:

ssh isn't recognized as the name of a cmdlet, function, script file, or operable program

ssh : The term 'ssh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
ssh
CategoryInfo : ObjectNotFound: (ssh:String) [], >CommandNotFoundException
>+ FullyQualifiedErrorId : CommandNotFoundException
I already have OpenSSH Client and OpenSSH server installed, but I still get this error message whenever I try to use ssh in powershell. I previously edited my PATH environment variable and deleted all of the default ones. However, adding the default values back have not fixed this problem.

After uninstalling Conda 3.8 cmd became unavailable

Overview
I uninstalled Conda and it broke cmd. I am unable to start cmd and I also get an error when opening a PS terminal. When I installed Conda I ran conda init for ps and cmd. I would like to reverse the effect of this command. I no longer have conda and so cannot use that.
Powershell behaviour:
conda : The term 'conda' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again. At line:1 char:1
conda init --reverse
+ CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Cmd behaviour:
Doesn't open, brief flash of a window.
Resolution
In the registry, there is a key; HKEY_CURRENT_USER\Software\Microsoft\Command Processor\autorun with the value set to if exists. I removed that key's value. If you have a statement that runs batch scripts, don't just bin it.
What is this key?
According to this resource the key is used to run batch scripts prior to opening cmd.
Why?
if exist was evaluating to false and that blocked cmd from starting. I tested with a dummy expression if exist 1=1 which led to cmd starting.
Culprit
This happened when uninstalling Conda 3.8.

While running a batch file from Windows 10 cmd I'm getting an error that a term is not recognised as cmdlet function

This is the exact error on the cmd window.
this is the command I typed to be executed in the cmd
F:\Fast R-CNN\Cognitive tool kit\cntk\Scripts\install\windows>install.bat
CNTK Binary Install Script
F:\Fast : The term 'F:\Fast' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ F:\Fast R-CNN\Cognitive tool kit\cntk\Scripts\install\windows\ps\inst ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (F:\Fast:String) [], CommandNotF
oundException
+ FullyQualifiedErrorId : CommandNotFoundException
Error during install operation
I've tried running as admin, direct clicking, changing the path etc. Kindly tell me a way to run this file. It's a batch file for a series of installations for the Microsoft cognitive tool kit.
Looks like you need to enclose the path in quotes
"F:\Fast R-CNN\Cognitive tool kit\cntk\Scripts\install\windows\install.bat"
use "start" before the filename.
Example:
F:\Fast R-CNN\Cognitive tool kit\cntk\Scripts\install\windows>start install.bat

CMD - is not recognized as an internal/external command [duplicate]

This question already has answers here:
What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?
(4 answers)
Closed 5 years ago.
I have a problem with "Command Prompt" :
How to solve this problem ?
You have to follow two steps for this :
1.navigate to that directory through command :
cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
2. Then execute your command.
stsadm -o uninstallfeature -name UserInterfaceWayBillActions -force
type in
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\stsadm -o uninstallfeature -name UserInterfaceWayBillActions -force
and hit enter

Resources