sqlite from command prompt- not recognized command - windows

I am trying to run sqlite from the command prompt.
So I have this downloaded sqlite-shell-win32-x86-3071100.zip from this website http://www.sqlite.org/download.html
Now there is a set up.exe from which v can run sqlite commands.
When I say
C:\Users\..>'sqlite3' is not recognized as an internal or external com
''sqlite3'' is not recognized as an internal or external command,
operable program or batch file.
Any hints.
Thank you
Sun

From your windows command prompt, you can start sqlite3 either with:
cd c:\Stuff
sqlite3.exe
or with:
c:\Stuff\sqlite3.exe
Either way, I assume from your comment that sqlite3.exe is in c:\Stuff.
As Michael mentioned, you can also add the path of the directory containing sqlite3.exe to your PATH. Fro a quick search I found this guide: http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx

I assume that you already have sqlite in your system path since the instructions on how to do this are clear.
The likely problem is that you have created a folder called sql3 and have put the three executable files in a folder within that folder.
Check that all three executable files are within the file itself.

Go to an environment variable and add new environment variable C:\sqlite as I have saved the sqlite3 files under sqlite folder of C drive. It worked for me

It maybe possible that when u have extracted files from the downloaded zip folder,2 folders are created of the same name one inside the other. So in the cmd prompt u have to enter that folder 2 times by using .
E.g-C:....\sqlite-tools-win32-x86-3330000\sqlite-tools-win32-x86-3330000
and then use sqlite3

If your sqlite3.exe is in C:\Stuff, you can check really quick to see if it's in your PATH.
echo %PATH% will give you your full path. If you don't see ;C:\Stuff there (probably near the end), that's why windows can't find sqlite3.exe.
If you don't see it, run:
setx path "%PATH%;C:\Stuff"
That should be problem solved. Open a new command prompt (it only updates PATHS when the terminal opens), run echo %PATH% and you should now see ;C:\Stuff at the end.
Congrats. sqlite should work in the terminal moving forward.

Related

Adding lua.exe to my system path

I've been having difficulty setting up lua as a system path. I'm attempting to run lua programs via the command prompt. I've followed multiple stackoverflow answers for similar questions:
Running a lua program from a text file
to no avail. Regarding the link's four steps: I'm able to complete step one no problem, would like to complete step three and step two onward have thoroughly confused me.
I've edited my PATH variable to include what I believe the correct path for lua is: C:\Program Files\Lua\5.3.4_64\lua53.exe. I feel like this is where I'm botching it.
This is the general output when I try to run lua from a cmd prompt within the folder holding lua.exe or outside of it.
C:\Program Files\Lua\5.3.4_32>lua main.lua
'lua' is not recognized as an internal or external command,
operable program or batch file.
If anyone can help or needs more information to help please let me know and thank you in advance.
You need to add the folder of lua53.exe to the PATH variable. That is, add C:\Program Files\Lua\5.3.4_64, not C:\Program Files\Lua\5.3.4_64\lua53.exe. Then when you type lua53 in the command prompt, the command processor will search in that folder for lua53.exe and run it.
If you want to run Lua in the command line with the name lua, you will have to rename lua53.exe to lua.exe, or create a batch file named lua.bat with the content lua53 %* and save it in the same folder as lua53.exe. (%* is a variable that copies the arguments that you typed after the name of the batch file. That is, if you type lua -e "print 'Hello, world!'" in the command line, it will execute the command lua53 -e "print 'Hello, world!'".)

Using CMD to open an .exe file, from the same directory?

Im trying to make this launcher for my game.
But I can't seem to find anywhere, how to open a file. Without specifying the location.
Like I want it to run a file, from the same folder as the .cmd file is in. (The one I created).
Been searching for ages, without finding out how.
Reasoning: The user is able to change where the game is going to be installed. So I cant specify a location..
Simply open Command Prompt. Then Drag and Drop your .exe file to the console. (This will copy the location of the .exe file to the console) Then just press "Enter". Then your .exe file should be running.
References http://www.howtogeek.com/209694/running-an-.exe-file-via-command-prompt/
Hope it helps
The argument %0 of a batch file references the name of that batch file. So to run an exe located in the same folder where your batch file is, use:
%~dp0program.exe
The ~dp expands the argument %0 to a full qualified path name - including a trailing \ that's why there is no \ between %~dp0 and program.exe
Details about expanding variables can be found by typing help for on the commandline
Turned out, it was just me being foolish.
Forgot that I could just type in the name of the file.
Instead of doing something big out of it.
Thanks #ByteHamster for refreshing my memory :)
"Quote" ByteHamster: If you are in the same folder, just type in the name of the exe file.

Windows 7 Command Prompt: How do I execute a batch script from the command line?

I'm using Windows 7, and my problem is running this file from a console (cmd.exe):
W:\software\projects\myproject\build\msvc\build.bat
When I move into the folder containing the file manually and run it from there using the following command sequence, it works:
W:\>cd software
W:\software>cd projects
W:\software\projects>cd myproject
W:\software\projects\myproject>cd build
W:\software\projects\myproject\build>cd msvc
W:\software\projects\myproject\build\msvc>build.bat
However, when I try to run the file from the root directory in any of these ways:
W:\>software\projects\myproject\build\msvc\build.bat
W:\>call software\projects\myproject\build\msvc\build.bat
W:\>#call software\projects\myproject\build\msvc\build.bat
W:\>"software\projects\myproject\build\msvc\build.bat"
W:\>call "software\projects\myproject\build\msvc\build.bat"
W:\>#call "software\projects\myproject\build\msvc\build.bat"
I get the following error message:
The system cannot find the path specified.
I'm pretty sure you didn't have to navigate to the folder containing the file in order to run it when I was using Windows XP (though I could be wrong, of course), but this apparently seems to be the case with Windows 7. Or am I missing something?
You are correct. You do not need to navigate to the batch scripts folder before executing.
The error "The system cannot find the path specified." is most likely caused by something inside your batch-file.
Try to add
cd W:\software\projects\myproject\build\msvc
w:
or in a single command (as suggested by James K, Thanks!)
cd /d W:\software\projects\myproject\build\msvc
Searched a bit more and found this generic solution:
cd /d %~dp0
at the top of your batch file to set the working directory to the directory of the script to check whether this is the cause.
If you execute your file from W:\ this is where the commands are executed (working directory). It is most likely that your script cannot find some file it uses in this location.

can't execute cvs command in DOS in windows 7

When cvs is typed in cmd.exe in windows 7 nothing is output. The path of the cvs is already in the PATH :C:\Program Files (x86)\CVSNT\; When typing "C:\Program Files (x86)\CVSNT\cvs" there are outputs there. But when other .exe e.g. calc is typed the corresponding program can be executed. Any idea?
This might sound like a strange suggestion, but try cvs.exe instead of just cvs. Without specifying an extension, your operating system will search for the first file that matches the name, cvs. If it happens to find cvs.bat in one of your paths, then it will execute the .bat file instead of the.exe.
If you have cvs.bat , cvs.com, and cvs.exe within the same directory. The order of precedence would be the following:
cvs.com
cvs.bat
cvs.exe
I have a strong suspicion that there's a blank cvs.bat file hidden somewhere in one of folders defined in your path variable, and that you are actually running this batch file when you type cvs.
HI the answer is Run the exe with full path like "C:\Program Files (x86)\CVSNT\cvs.exe" followed by CVS arguments like -q Checkout.....

ActivePerl Installation on Windows operating system

I have installed ActivePerl on my Windows OS. I have followed below URL
procedure to install
ActivePerl Installation
After having done that, I have tried to run "perl -v " on the command line. But it reports the following error.
The system cannot execute the
specified program
What do I need to do to solve these issues?
I was facing a similar issue... but the thing was that I could execute the file by right clicking the file and opening it with perl command line interpreter.... but still the perl-v command would give the error... all I had to do was execute this command
set PATH=C:\Perl\bin;%PATH%
This solved the issue...
You need to make sure the directory where the Perl executable lives (it might be C:\perl\bin, but basically wherever you told ActiveState Perl to be installed) is in your PATH environmental variable (you can find the variable value by typing set PATH command on command line prompt in Windows).
If you're not sure where you installed Perl to (and can't find it in the default C:\perl\bin), you can find the directory by going to Start menu, finding ActiveState Perl folder, and right-clicking on "Perl Package Manager" icon, then pick "Properties" from the right-click menu. Properties window (in the "Shortcut" tab) will have a "Target" line showing the directory.
I was getting a similar error after installing ActiveState Perl on Windows 8 x64 bit edition and trying to invoke 'perl' at the command line.
'perl' is not recognized as an internal or external command, operable
program or batch file.
I remember selecting the option during installation to add the Perl directory to the system PATH environment, and after checking the system properties, it was indeed showing in the system PATH.
I tried installing 'Microsoft Visual C++ 2008 x86 and x64 redistributable setup' files as suggested by a few places but it still did not resolve the issue, until I tried some of the suggestions in this thread.
At the command prompt I entered:
set PATH
And surprisingly it did not list the Perl directories as being included in the PATH variables.
So to remedy that I entered this into the command prompt and hit enter:
set PATH=C:\Perl64\bin;C:\Perl64\site\bin;%PATH%
(The directory paths are for the 64 bit edition of Perl, adjust according to your installation) the %PATH% portion is important and ensures your existing settings are kept and not wiped out and overwritten when you set the PATH.
That fixed it and entering 'perl -v' into command prompt successfully replies your Perl version. If you had a PowerShell window open before setting the PATH variable, you will need to close it and re-open another instance of PowerShell.
I believe the original underlying issue was something to do with different PATH variables for 32-bit and 64-bit environments and possibly some internal Windows redirection that takes place automatically.
This doesn't sound like a problem with PATH - I would expect it to give the message 'perl' is not recognized as an internal or external command, operable program or batch file.
I have not seen this error message, but http://nirlevy.blogspot.com/2008/03/system-cannot-execute-specified-program.html makes some suggestion for related programs.
Or maybe ask on an Active State forum.
I had the same error. I was able to solve it by changing the order of the Perl64 entries in the PATH variable in the Environment Variables. I moved the C:\Perl64\bin to be before C:\Perl64\site\bin and it worked.
I had a similar error which was solved by adding the .pl extension to the script name, which I had forgotten to do.
I could not get it to work otherwise even with my Perl's location (C:\Apps\Perl\bin) verified as in %PATH%.
The problem lies in the installation directory.
The Perl PATH variable will be set to C:\Program Files\perl (depends on 32 or 64 bit of course), BUT, the default installation directory is C:\perl. This is kind of sneaky actually as you would assume the installer would be more intelligent about this, but it sets the environment variable to that directory no matter WHERE you install the damned thing.

Resources