Windows命令外壳中的TAB字符 [英] TAB character in windows command shell

查看:148
本文介绍了Windows命令外壳中的TAB字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我只是想知道是否有人知道将制表符添加到Windows命令外壳程序的方法吗?我一直在使用Google的功能来帮助我,但我还没有弄清楚我需要什么.这使我怀疑我无法添加制表符.

顺便说一句,对于传递给C ++应用程序的字符串操纵器程序,我需要它.

谢谢大家的光临!
robNO.

更新:其他问题!
我还想知道是否可以使用任何ASCII字符?

解决方案

实际上AFAIK命令提示符中使用的Tab键是可配置的(至少在XP中).

最简单的方法是从Microsoft的PowerToys(链接 [ ^ ])包并更改文件名完成在命令提示符"下.希望这会有所帮助!

更新:

对于Windows 7,您可以提供此教程 [
系统外壳本身很好地传递了TAB,通过其命令行传递给应用程序并被该应用程序识别.为了确保它能正常工作,使用一些从常规文本框控件中获取字符的外壳程序就足够了.可以轻松编写这样的应用程序(过去,我已经基于成熟的文本编辑器界面以及搜索等功能完成了替代shell).
另外,我使用了Total Commander的命令行提示符(我必须使用Paste添加选项卡)-相同的结果:TAB正常工作.

如果您需要制作一个接受TAB和其他字符的命令行工具,则可能需要引入一些转义系统,例如"\ t","\ n"等(不要忘记转义"\").它本身,例如"\\").否则,请像我一样提供其他外壳(一些管理员很高兴获得这份礼物).

谢谢.
--SA


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?

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!


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. :)


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


这篇关于Windows命令外壳中的TAB字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆