You are here

Command Prompt Portable

4 posts / 0 new
Last post
Last seen: 6 months 1 week ago
Joined: 2007-08-27 13:35
Command Prompt Portable

One of my frustrations when using a command prompt on a different machine is not having the file name completion functionality set up. It's usually turned off. I can turn it on with /F:ON (I think) in a batch file, but the control key to use (I prefer tab) is specified in the registry.

I know I wouldn't want someone else changing my preference permanently...

So I'm asking if anyone else has already worked on this sort of thing. Maybe you know of a way to set it -- like color or prompt -- that works just for one invocation?

If not, should I just hack at the current CommandPromptPortable.nsi script to see if I can come up with a version that does it gracefully, setting the registry and then returning the setting to its previous condition?

If I do come up with something, should I share it here?

Any other settings I could be looking at?

This looks like it might be a relatively simple project to get my feet wet with nsi.

BuddhaChu's picture
Last seen: 6 years 3 months ago
Joined: 2006-11-18 10:26
It's 'cmd /f' or 'cmd /f:on'

It's 'cmd /f' or 'cmd /f:on' to turn it on. Looks like you'll have to do your registry idea to make it the Tab character.

BTW: command completion is turned on by default on Win2k and higher and the default is the Tab button. If either of those has changed, someone has jacked with your settings in some manner (Active Directory policy, login script, etc).

EDIT: according to the second link above, on WinXP command completion is off by default. Every machine I've used that Win2k or higher has had it on by default so who knows. YMMV.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

Last seen: 6 months 1 week ago
Joined: 2007-08-27 13:35
off by default is my experience

I guess I've not done it on win2k much, but on XP I find it off more often than not.

I believe I can tweak the registry just before calling cmd.exe to turn it on. I'm guessing that after cmd.exe is called, I could switch it back again, and that cmd instance will stay the way I want it.

Or should I leave the CommandPromptPortable program running in the background and only put the original settings back when that instance of cmd.exe exits? Or does it matter?


Last seen: 12 years 2 weeks ago
Joined: 2006-07-27 17:05
Be cautious

If you're really concerned about not changing the host system you need to be careful about when you modify and restore the registry settings. If you try to do the restore after cmd.exe exits you'll have problems when someone launches multiple instances of CPP and doesn't close the first instance opened last, or when things are shutdown abnormally. I recommend doing set/start/restore in short sequence. There's still a possible race condition but at least it's a much smaller window.

Log in or register to post comments