How can I create an icon\shortcut to a script that opens cmd.exe
command prompt at a certain location on a certain drive under Win7?
3 Answers
i don't know in windows 7, but in windows xp and previous:
- create a shortcut to c:\windows\system32\cmd.exe
- right-click -> properties
- in the "start in" write the desired target folder (e.g. f:\aviv\geffen)
click ok, and there you go.
-
This is the best answer to the question I've asked, however the
/K
based approach in my answer is more flexible, e.g.cd
somewhere and then run a script or two.– JonathanJan 5, 2012 at 18:54
Create a shortcut to cmd.exe, then go to its properties and edit the Target:
C:\Windows\System32\cmd.exe /K "D: & cd eclipse"
This would first change the current directory to D:
and then cd
into eclipse
folder
-
1
-
Or change the value in the "Start in:" field to the drive and folder you wish to start CMD.EXE in. The default value is
%HOMEDRIVE%%HOMEPATH%
which can be configured to be otherwise.– IsxekJan 3, 2012 at 13:44 -
1
-
-
You should mark this as the answer to the question so people don't attempt to answer it.– RamhoundJan 4, 2012 at 14:09
Within Windows 7 you can just hold down the Shift key when right clicking a location and the Open Command Window Here
option will then appear in the right-click menu. The starting location (path) is your right-click destination!
For previous versions of Windows, I came across this plug-in which inserts a 'Open Command Prompt' option into the right click menu - it will open it in the current folder/multiple command prompts in multiple locations with just a few clicks.
-
1This doesn't answer the actual question of doing this from within a script. And furthermore since Win7 there's no need for a plugin, just hold down the Shift key when right clicking a location and the "Open command window here" option will then appear in the menu.– OldskoolJan 3, 2012 at 13:59
-
You should've posted that as an answer then, i'm pretty sure the OP is totally unaware of this feature - as was i. I'll edit my answer to contain it.– HaydnWVNJan 4, 2012 at 10:58
-
It doesn't read that the OP is using a script, he asked if a script was the solution– HaydnWVNJan 5, 2012 at 11:12
-
1