none
how to implement ctrl+l for windows cmd? RRS feed

  • Question

  • In linux terminal as I give ctrl+L signal, terminal screen clears. I found that cls command is used to clear screen in windows. How can I make ctrl+L signal in case of windows cmd to clear screen.
    Monday, September 29, 2014 7:52 AM

Answers

  • Ctrl+L is an old teletype holdover. Ctrl+L is ASCII character 12 and means "form feed." The form feed character is sometimes used in plain-text files to insert page breaks.

    The Windows console does not interpret character 12 to clear the screen, so as already mentioned, your only option is a third-party tool that can detect you are in a console window and send the "cls" command to it.

    This has nothing to do with scripting. Autohotkey can probably do it but this is not the right forum to ask about third-party tools. If you want to use Autohotkey, ask on the Autohotkey forum rather than here.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, September 30, 2014 7:02 PM
    Moderator

All replies

  • Might try them over here.

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=scripting

    http://social.technet.microsoft.com/Forums/scriptcenter/en-us/home?forum=ITCG

    http://answers.microsoft.com/en-us/windows

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Monday, September 29, 2014 11:29 AM
  • Sir, 

    I am new in this forum. please tell me how to move this question to another one.

    Monday, September 29, 2014 12:48 PM
  • You can't, but I can if you tell which one you prefer. Otherwise just start a new thread in desired forum.

     

     

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Tuesday, September 30, 2014 12:36 AM
  • Tuesday, September 30, 2014 9:52 AM
  • You got it.

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Tuesday, September 30, 2014 10:15 AM
  • Sir,

    Thanx for moving it ....

    Tuesday, September 30, 2014 10:20 AM
  • This is not a scripting issue.  There is no way to set a shortcut or keystroke in a console window.  Just type cls.

    You can use third party tools to do this: https://www.automationanywhere.com/macro-record?r=google&w=windowsmacro&kw=Windows%20Macros&match=b&network=g&place=&gclid=CjwKEAjwqamhBRDeyKKuuYztxwQSJAA1luvGYXE-ouPDFNFKVSfC63ZhWTPw7a9U-yRtdjii8RQYdxoCBfTw_wcB

    Ctrl-L is a Unix terminal command and not part of the shell.  It works if you are emulating the correct terminal.  It does not work on most non-VT compatible emulations.  Windows does not emulate terminals.


    ¯\_(ツ)_/¯

    Tuesday, September 30, 2014 10:35 AM
  • Sir, 

    Thank you for response

    I used Autohotkey installer http://www.autohotkey.com/ .

    with the help of this i am able to do ctrl+L. Means there is some way to make ctrl+L for windows also. May i know some hints or way to implement this. I tried to use some apis but its working for attached window only. I used RegesterHotKey api. And I also find if I give  Ctrl+L from another window, it reflects in attached window.

    Please help me. and move this thread at right place

    thanks

    Tuesday, September 30, 2014 10:51 AM
  • You are in the wrong forum and your assumption is completely incorrect.  What autokey does is to add the ability to use macros in a CMD prompt. This is not part of Windows.  You can write a program that will do this but it cannot be done via a script.

    Please post your questions in a user forum such as answers.microsoft.com for further assistance.


    ¯\_(ツ)_/¯

    Tuesday, September 30, 2014 10:58 AM
  • Ctrl+L is an old teletype holdover. Ctrl+L is ASCII character 12 and means "form feed." The form feed character is sometimes used in plain-text files to insert page breaks.

    The Windows console does not interpret character 12 to clear the screen, so as already mentioned, your only option is a third-party tool that can detect you are in a console window and send the "cls" command to it.

    This has nothing to do with scripting. Autohotkey can probably do it but this is not the right forum to ask about third-party tools. If you want to use Autohotkey, ask on the Autohotkey forum rather than here.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, September 30, 2014 7:02 PM
    Moderator
  • Thank you Mr. Bill

    Please move this thread at suitable forum. Because I think that I have not enough rights to do that.

    As you said Autohotkey is provides a way to do Ctrl+L. I tried to set macros but they are limited to current console only and I think we can not make command like Ctrl+<some key> from macro.

    Since Autohotkey is doing this. and it reflects in every console. Please suggest me a way so that I can also make some program which work like Autohotkey. I don't asking you to telll how Autohotkey developed but asking you some basic approach so that i can do simple task like registering Ctrl+<any key> or Alt+<any key> for any console like AutohotKey did.

    Thank you for helping.

    Wednesday, October 1, 2014 6:55 AM
  • Thank you Mr. Bill

    Please move this thread at suitable forum. Because I think that I have not enough rights to do that.

    As you said Autohotkey is provides a way to do Ctrl+L. I tried to set macros but they are limited to current console only and I think we can not make command like Ctrl+<some key> from macro.

    Since Autohotkey is doing this. and it reflects in every console. Please suggest me a way so that I can also make some program which work like Autohotkey. I don't asking you to telll how Autohotkey developed but asking you some basic approach so that i can do simple task like registering Ctrl+<any key> or Alt+<any key> for any console like AutohotKey did.

    Thank you for helping.

    You would need to hire a trained engineer to do what you ask.  This is not something a non-engineer could easily do and it cannot be done with a script.

    As Bill has noted you will need to post in the AutoHotKey forum.  We cannot move this thread to another vendor's forum so you will have to start the post there yourself.


    ¯\_(ツ)_/¯

    Wednesday, October 1, 2014 11:52 AM