If I connect a Phone with my Windows 7 machine via USB, it shows up in explorer with a name e.g. Nexus 5. How can I open a command prompt and change directory to this device. For lettered drives, I can just type D: F: etc.
In order to assign a drive letter to a removable device, that device must support UMS (USB Mass Storage) protocol. Unfortunately most newer Android phones, especially those without a removable SD Card, do not support UMS. Instead, they support MTP (Media Transfer Protocol) and PTP (Picture Transfer Protocol) protocols. In such devices it's not possible to map storage as a drive in Windows.
See more details on this Superuser.com question.
With that said, on some selected Samsung and Sony Android devices it's possible to enable the UMS mode for external storage only (SD Card). See this app.
Also, if your goal to simply copy files to and from an Android device via command prompt, ADB will allow you to do so. This utility is part of Android SDK tools. You will need USB drivers for your android phone to be installed, USB Debugging activated in Developer Settings on the phone, and authorize the PC to debug the phone (via a prompt on the device.) After that is done, you will be able to use
adb push and
adb pull commands to copy files & directories, and various Linux shell commands via
adb shell <command> (e.g.
adb shell ls /sdcard/) to navigate the directory structure on the phone.
You can try to install a WebDAV server to the android device, then mount the WebDAV server as a drive on Windows 7. Here is a free WebDAV server from Google Play (Of course, there are many other WebDAV servers in Google Play). And the steps to mount the WebDAV server as a drive on Windows 7.
There are several ways to do it. Unfortunately it is not as easy as it should be. Follow the instructions here: http://www.7tutorials.com/how-map-drives-windows-7
If you already have the share in File Explorer, for instance after inserting an USB device, right click on the share and select Map Drive and select a drive letter.