Originally posted by Michael Mattias
View Post
You will probably want to use "cmd.exe /k cd" instead, since that will invoke the win32 console which is more powerful in today's environment.
Command.com is the MS-DOS interpreter and is much less flexible - although for basic use the differences aren't too obvious. MS-DOS simulation was more important before, which probably explains why the sept 2001 newsgroup mention command.com. In addition, the "/k" switch isn't documented (checked against XP), but it works and behaves as prescribed.
Also, in this scenario - under XP - the "cd" part is superfluous, and a simple "cmd.exe /k" will do.
For good measure, you probably would want to have a as-fast-as-possible startup of cmd.exe and not spend time

However, this approach will not resolve environment variables for you, so you will need to resolve it manually. In the end you should end up with something like: "C:\Windows\system32\cmd.exe /k" depending on the value of your %SystemRoot% variable (check it using the "SET <enter>" command from within a console window).
The method under XP is also different from described above. Proceed as follows:
- Start Explorer.
- Select Tools>Folder Options>File Types>File Folder
- Click "Advanced"
- Click "New"
- In "Action" enter the text to be displayed in Explorer, e.g. "Console window"
- In "Application" enter your command "C:\Windows\system32\cmd.exe /k"
- Click "OK" and close all dialogs to return to the explorer main window.
- Right-click on a folder, select "Console window" and - voilá! There it is!
BEWARE: Under XP this is a one-way thing only - you will not be able to edit nor remove it afterwards! One error here, and it's in there forever... unless you edit the registry directly, in which case you may enter, edit and remove this command as you wish. Four entries are necessary:
Create the following two keys:
Code:
HKEY_CLASSES_ROOT\Directory\shell\Console_window HKEY_CLASSES_ROOT\Directory\shell\Console_window\command
Code:
HKEY_CLASSES_ROOT\Directory\shell\Console_window
In key
Code:
HKEY_CLASSES_ROOT\Directory\shell\Console_window\command
As can be seen default registry values are all REG_SZ values, and REG_SZ values don't expand environment variables so you need to expand the command manually.
Final comment (something for PB staff?):
In my preview of this post, the key "HKEY_CLASSES_ROOT\Directory\shell\Console_window\command" was displayed with a space between "\c" and "om" yielding "\c ommand" both places until I enclosed the lines with CODE tags. I have not edited the lines themselves after inserting the CODE tags. In this final comment, the same string is displayed as "\ command" with a space between the last back-slash and "command". Time will show if this behaviour transfer into the live forum.
ViH.
Leave a comment: