我怎么能集设置昏迷,分号或等号开始一个标题? [英] How can I set set a title that start with coma,semicolon or equal sign?

查看:262
本文介绍了我怎么能集设置昏迷,分号或等号开始一个标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然,这是可以设置包含CMD的标准分隔符标题,但通过标题命令看起来不可能设置一个分隔符开头的标题。

Obviously it is possible to set title that contains cmd's standard delimiters but through TITLE command looks impossible to set a title that starts with a delimiter.

有可能创造CMD的一个新实例,例如标题

It is possible to create a new instance of CMD with such title:

start "==" cmd.exe

但不可能同一个实例。

but not possible for the same instance.

这可能也与.NET和 Console.Title 属性,但,当它从批处理文件名为瓦只要持续的编译的exe运行:

It is possible also with .NET and Console.Title property but when it's called from batch file the tile lasts as long as the compiled exe runs:

@if (@X)==(@Y) @end /* JScript comment
@echo off
setlocal

for /f "tokens=* delims=" %%v in ('dir /b /s /a:-d  /o:-n "%SystemRoot%\Microsoft.NET\Framework\*jsc.exe"') do (
   set "jsc=%%v"
)

if not defined jsc (
        echo !!! Installation of .NET framework needed !!!
        pause
        exit /b 3
)

rem echo %jsc%
::if not exist "%~n0.exe" (
        del /q /f %~n0.exe
        call "%jsc%" /nologo /out:"%~n0.exe" "%~dpsfnx0"
::)

call %~n0.exe %*

endlocal & exit  /b %errorlevel%


*/

import System;

var arguments:String[] = Environment.GetCommandLineArgs();
//Console.WriteLine(Console.Title);
if (arguments.length>0){
         Console.Title=arguments[1];
}
//Console.WriteLine(Console.Title); 

(也许有可能通过code注射液)

(Probably is possible through code injection)

有没有窗户'本土'的方式?

Is there a windows 'native' way?

推荐答案

使用Win7的X64,我可以生产它时,一个换行符是有问题的字符前面。

With Win7 x64, I can produce it when a linefeed is in front of the problematic characters.

@echo off
setlocal EnableDelayedExpansion
set LF=^



title !LF!,bc

在Win7的存在似乎当使用LF标题的高度或位置没有什么区别。

In Win7 there seems no difference in the height or position of the title when LF is used.

与测试

cmd /V:on
@for /L %n in (1 1 1111) do @(title !LF!=Hello& title +Hello)

但目前的方案是显示了它的标题运行时间,因此标题命令本身产生闪烁。

这篇关于我怎么能集设置昏迷,分号或等号开始一个标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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