Windows命令 - 如何删除闪烁的光标(提示?)

时间:2014-01-21 06:37:23

标签: windows batch-file cmd

我正在使用在命令窗口内运行的应用程序。现在在该应用程序内部,我添加了一些代码来运行外部程序。基本上它的作用是,它调用cmd.exe /c myprog.bat param1 param2,然后在myprog.bat内调用start /B c:\myapplication.exe

现在问题是,在我执行此代码之后,核心应用程序(控制台窗口应用程序)开始在窗口的左上角闪烁光标(我相信它被称为提示符)。我尝试在我的代码之前和之后调用echo offecho on,但这没有帮助。

有没有人知道如何删除此闪烁提示?

4 个答案:

答案 0 :(得分:4)

使用纯Batch命令无法做到这一点;需要第三方程序。

您可以使用我的CursorSize.exe辅助程序来执行此操作。这是它的帮助屏幕:

Get or set cursor size.

CursorSize [size|/L]

The cursor size is a percentage (1..100) of the character cell that is filled by the cursor.
Use 0 to hide the cursor; use /L to recover the last hidden cursor.

要获取CursorSize.exe文件,请在this post查找程序10-CursorSize.exe.hex;您还应该阅读该主题开头的说明。

答案 1 :(得分:0)

Aacini说了什么,或者这些选择:

Noblink,TSR不允许闪烁的游标。 Console,更好的cmd.exe。

答案 2 :(得分:0)

enter image description here

::---------------------------------------------------------------------::
:: try this see the picture, (plus multicolor line echo)               :: 
:: the lines with base64 endode echo, generate bg.exe to do the job    :: 
:: bg can do: remove cursor blink, print multi color line & more       ::
::---------------------------------------------------------------------::

@echo off && setlocal enableextensions disabledelayedexpansion

(

if exist "%temp%\bg.b64" del /q /f "%temp%\bg.b64"
if exist "%temp%\bg.exe" del /q /f "%temp%\bg.exe"

) >nul 2>&1 

call :_base64_to_exe  &&  Certutil.exe -decode "%temp%\bg.b64" "%temp%\bg.exe" >nul 2>&1

   if exist "%temp%\bg.exe" ( 

     "%temp%\bg.exe" cursor 0 && "%temp%\bg.exe" print \n 

     "%temp%\BG.exe" print 6 " Where" f " is" b " the" a " cursor" c " now" e " ?"

     "%temp%\bg.exe" print \n 


      if exist "%temp%\bg.b64" del /q /f "%temp%\bg.b64" >nul 2>&1
      if exist "%temp%\bg.exe" del /q /f "%temp%\bg.exe" >nul 2>&1

     ) else ( 

     color c && echo/E R R O R: "%temp%\bg.exe" not found...
     if exist "%temp%\bg.b64" del /q /f "%temp%\bg.b64" >nul 2>&1

     )

goto :_end_of_file

:_base64_to_exe

(echo/-----BEGIN CERTIFICATE-----
echo/TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5v
echo/dCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAECAAAAAAAAAAAAAAAAAOAADwMLAQYAAAAAAAAAAAAAAAAA1x0AAAAQAAAAIAAAAABAAAAQAAAAAgAA
echo/BAAAAAAAAAAEAAAAAAAAAAAwAAAAAgAA5xUBAAMAAAAAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAHAgAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
echo/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADUIAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC50ZXh0AAAA
echo/KA8AAAAQAAAAEAAAAAIAAAAAAAAAAAAAAAAAACAAAGAuZGF0YQAAAJAEAAAAIAAAAAQAAAASAAAAAAAAAAAAAAAAAABAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
echo/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVieWB7AAAAACQuAMAAACLDYAkQAA5yA+FGwAAAIsFhCRAAIPACIsIiQ3EI0AA6OoJAADp4wAAALgEAAAAiw2A
echo/JEAAOcgPj9AAAAC4AgAAAIkFACRAAIsFgCRAAEiJBQQkQAC46CNAAFCLBeAjQABQ6NsNAACLBQAkQACLDQQkQAA5yA+NfgAAAIsFACRA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wdXRBAAAAR2V0TG9jYWxUaW1lAAAAU2xlZXAAAABH
echo/ZXRDb25zb2xlQ3Vyc29ySW5mbwAAAFNldENvbnNvbGVDdXJzb3JJbmZvAAAAU2V0Q29uc29sZUZvbnQAAABXcml0ZUNvbnNvbGVPdXRwdXRBAAAAR2V0Q29uc29sZVdp
echo/bmRvdwAAAEdldENvbnNvbGVPdXRwdXRDUAAAAFNldENvbnNvbGVPdXRwdXRDUAB3aW5tbS5kbGwAAABQbGF5U291bmRBAHVzZXIzMi5kbGwAAABTaG93V2luZG93AAAA
echo/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
echo/-----END CERTIFICATE-----)>>"%temp%\bg.b64" && exit /b || echo/ Base64 to exe unsuccessful...

:_end_of_file

这个想法来自这个link

答案 3 :(得分:0)

如果您使用的是 Windows 10,ANSI 转义序列应该可以正常工作。

您可以通过以下方式获取转义字符:

for /F "delims=#" %a in ('prompt #$E# ^& for %a in ^(1^) do rem') do set esc=%a

因此:

echo.%esc%[?25l

会隐藏光标。

字母“l”是字母“L”,但不是大写。