I have many scripts which I interact with from the command line. Everytime I need to use them, I have to open a command line window and copy+paste and CD to the path to the directory they are in. This is tedious (they are in a rather deep file system, so typing out the full path is a pain, copy+paste is better but not much). I tried to create a .BAT file that I could double-click on that would open a new command-line window in the folder the .bat file exists in but it does not work. It opens a new window, but the working directory is not the directory that .bat file is in. Here's what I've got after much googling (My cmd skills ain't so great):
cd %CD%
cmd.exe
I know from when I used Linux that Konqueror had a "Command-line window here" feature, and that's the effect I'm trying to get on Windows.
You can just enter
cmd
into the address bar in Explorer and it starts up in that path. Likewise for PowerShell.this code works for me name it
cmd.bat
Create a new file startCmdLine.bat in your directory and put this line in it
That is it. Now double click on the .bat file. It works for me.
You can replace call with start, it will also work.
you probably want to do this:
this will set your current directory to the directory you have the batch file in
May be a little old quest, but for the ones like me googling for this, you can hold shift and right click the folder. That way the content menu ill show open command window here.
A bit late to the game but if I'm understanding your needs correctly this will help people with the same issue.
Two solutions with the same first step: First navigate to the location you keep your scripts in and copy the filepath to that directory.
First Solution:
You can now use any of your scripts as if you were already that folder.
Second Solution: (can easily be paired with the first for extra usefulness)
On your desktop create a batch file with the following content.
This will open a command window like what you tried to do.
For tons of info on windows commands check here: http://ss64.com/nt/