Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Everybody!

I am just wondering if anybody knows a way to add the tab character to the windows command shell? I have been using the powers of google to help me but I have not figured out what I need. Which leads me to suspect that I cant add the Tab Character.

BTW I need this for a string manipulator program that I am passing in to a c++ application.

Thanks for everyone's time!!
robNO.

UPDATE: OTHER QUESTION!!!

I am also wondering if there is any way to use any of the ASCII characters?
Posted
Updated 25-Jan-11 14:16pm
v4
Comments
[no name] 27-Jan-11 7:17am    
In some programs like Windows Internet Explorer symbol "%" is used. "%9" for Tab.

Actually AFAIK the Tab key used in command prompt is configurable (in XP at least).

The easiest way to do this is to download TweakUI from Microsoft's PowerToys (link[^]) pack and change the "Filename completion" under "Command Prompt" to whatever. Hope this helps!

UPDATE:

For Windows 7 you can give this Tutorial[^] a try.
Apparently the tab key can be disabled either by registry (for all instances of cmd.exe or by using:

cmd.exe /F:ON

or
cmd.exe /F:OFF


I'm still on XP so you need to test that yourself. Let me know how it goes!
 
Share this answer
 
v3
Comments
RobNO 26-Jan-11 16:58pm    
Thanks for your reply!

I am using windows 7. I should have mentioned that earlier.

Thanks for your time!
robNO.
tolw 27-Jan-11 0:47am    
The fix seems to work for Win7 as well, but you need to edit the registry yourself. See the update to my answer.
RobNO 27-Jan-11 7:37am    
Thanks for the reply!!

/f:off. /f:on works! I was not able to try anything with the registry, because I really do not know anything about it.

Thanks for your time!!!
robNO.
I don't say it can't be done but under normal circumstances when at the command prompt the tab key cycles through the files in the current directory, or autocompletes a partial path. Or it did when I were a lad, anyway. :)
 
Share this answer
 
Comments
RobNO 25-Jan-11 20:11pm    
It still does. However, I was hopping that there would be an escape key or some other possible way. I would hate to go back and redesign the current project I am working on, however, that is just the way thing happen some times.
RobNO 26-Jan-11 16:59pm    
Thanks for your reply and time by the way.
robNO.
Funny question. I tested it. It looks it's only a problem with standard shell program "cmd", where entering TAB is just impossible.

The system shell itself nicely pass the TAB through, delivers to the application through its command line and recognized by that application. To make sure it works it's enough to use some shell that takes character from normal text box control. One can easily write such application (In the past, I've done alternative shell based on fully-fledged text editor interface, with search, etc.)
Also, I used command line prompts of Total Commander (I had to add tab using Paste) -- same result: TAB is working.

If you need to make a command-line tool which accept TAB and other characters you may want to introduce some escaping system, for example "\t", "\n", etc. (don't forget escaping of "\" it self, such as "\\"). Otherwise, provide an alternative shell as I did (some admins were very happy to get this gift).

Thank you.
--SA
 
Share this answer
 
v2
Comments
RobNO 26-Jan-11 16:55pm    
Thanks for your reply!

This is another silly question! What do you mean by system shell, would you be able to direct me to what you are referring to? I am using Windows 7 by the way.

I would be very interested in making an application that does this, however, I have only ever used system commands in c++. What commands would give me the access I am looking for.

Thanks for your time!!
robNO.
Sergey Alexandrovich Kryukov 26-Jan-11 17:51pm    
I mean Shell API vs shell "application" which is launched via "cmd" (its behavior suggests it uses regular system console as any console application could do). You can create process in different ways: you can call API "CreateProcessEx" or pass parameter to Shell API, which is supposed to have the same effect as manual start from the Shell, example: System Start menu, than "Run". By the way, this is another way to pass TAB (enter this character via Clipboard).

>I would be very interested in making an application that does this
Please, what do you mean by "this"? If you mean replacement of shell application, it's not "commands". This is running same very CreateProcessEx with re-direction of 3 standard streams: input, output and stderr. My original application is native WIN32, written in Delphi, which is not installed on my current working computer. Do you want to develop such application? Potentially, I could provide some directions but afraid it would take considerable time.

With your string manipulation application is can do easier job. 1) you can develop "input language with escapes", simply borrow C++ string literal syntax, 2) develop both UI and Console version of the application based on the same code (DLL); so UI version will provide a text box for input. I would recommend not to give up console application, especially if this is for advanced users.

If you clarify what you need and ask further questions I'll try to answer.

Thank you.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900