BAT file to open CMD in current directory?

You probably want to do this: cd /d %~dp0 cmd. Exe this will set your current directory to the directory you have the batch file in.

Yes! It works! Now where can I find an explanation for this?

– FrustratedWithFormsDesigner Dec 15 '10 at 15:45 1 'cd' is a system specific command - implemented by microsoft for their commond-line and '%~dp0' is simply the variable that holds the path the currently executing batch file is located in - therefore executing this command will take you to that directory (apparently this variable is only available from a batch file, which makes sense) – Chris Dec 15 '10 at 15:51.

Create a file named open_dos_here. Cmd with the following lines: %~d1 cd "%~p1" call cmd Put this file at any folder. Then, go to your Send To folder Create a shortcut to point to this open_dos_here.

Cmd Then, in any folder, select any file or sub-folder. Right-click and select Send To and then select open_dos_here. Cmd to open the DOS in that folder.

That is awesome! Only problem is that the window that opens does not use the size that I set. I set DOS to run in a wider-that-normal window and using this trick, it opens in what looks like a default-width window.

Why is it falling back to the default? – FrustratedWithFormsDesigner Dec 16 '10 at 15:08 You can go to the send-to folder. Find out the shortcut of open_dos_here.cmd.

Then, right-click and select Properties. Then, change the Font, Layout, etc to suit your style. Also, as seen form others post, add double-quotes like this : "%~p1" – Alvin SIU Dec 19 '10 at 15:33.

As a more general solution you might want to check out the Microsoft Power Toy for XP that adds the "Open Command Window Here" option when you right-click: microsoft.com/windowsxp/downloads/powert... In Vista and Windows 7, you'll get that option if you hold down shift and right-click (this is built in).

For me the upper solution works very well... maybe the quotes help if you have spaces in the file path, but I never had any problems with 'cd /d %~dp0' – Chris Jan 11 at 15:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions