5

I have installed SQLite3 on my computer in G:\SQLite3\sqlite3.exe

However, when I type "sqlite3" (no quotes) to PowerShell, it gives me the following error:

sqlite3 : The term 'sqlite3' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:1
+ sqlite3
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (sqlite3:String) [], CommandNotF
   oundException
    + FullyQualifiedErrorId : CommandNotFoundException

My Environmental Path includes G:\SQLite3, so when I run sqlite3 in command prompt (cmd.exe), it runs just fine. I prefer PowerShell though, so I would be glad, if someone could point me in the right direction how to make it accept this command. If that matters, I use Windows 8.

2
  • If you type the absolute path G:\SQLite3\sqlite3.exe or & "G:\SQLite3\sqlite3.exe" it run ? Commented Sep 21, 2014 at 18:48
  • Yes, it runs with absolute path. I don't want to type it everytime though ;) Commented Sep 21, 2014 at 21:58

1 Answer 1

7

Most likely the directory G:\SQLite3 is not in your PATH environment variable, so PowerShell doesn't know where to look for the executable. Either run the executable with its full path, or add the directory to the $env:PATH:

$env:PATH += ';G:\SQLite3'
& sqlite3.exe
Sign up to request clarification or add additional context in comments.

5 Comments

Your answer worked well - after typing that command to PowerShell, everything is good. However, I'm not sure WHY it worked - I already had the 'G:\SQLite3' in my Path variable, as proved by the fact that cmd.exe didn't have that problem. Perhaps it is the upper case that matters? (Path vs. PATH)
No, capitalization shouldn't make a difference. PowerShell is case-insensitive there. Double-check the spelling. Did you perhaps have C:\SQLite instead of G:\SQLite in $env:PATH?
Nope. I hope that I am looking in the good place there - Computer Properties > Advanced > Environmental Variables > Path. But it seems that it has a different set of paths than the one printed in teh PowerShell after typing $env:PATH - in particular, the one checked in console has "G:\SQLite3" appended to the end, and the other one in the beginning, where I typed it myself... Is there any difference?
Also, it seems that the solution is only temporary - when I restarted the PowerShell, the sqlite3 command stopped working again. Typing the $env:PATH += ';G:\SQLite3' solves the issue again, but it is tedious to have to write it every time I turn on the PowerShell. Is there any better solution perhaps?
OK. I seem to have found the real problem. And I feel quite stupid. After restarting the whole computer, everything works as I initially wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.