Move Cursor to 0,0

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
einstein1969
Expert
Posts: 941
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Move Cursor to 0,0

#1 Post by einstein1969 » 20 Feb 2014 16:50

Hi to all,

I need to find the faster method for move the cursor in position 0,0

I have seen many tools that work for this (like Aacini's utility) and the powershell method and i think tha ANSI.SYS can do that, I'm right?

I search for the faster "Bulk" method.

Preferred in the order: internal dos command, external but OS native (exe,com,dll), wsh (how to use the dynawrapper? or other) / mshta.

For whs and mshta or powershell is possible create an method that run continous and wait for a signal?

einstein1969

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Move Cursor to 0,0

#2 Post by carlos » 21 Feb 2014 00:51

this is cursor0.exe
this left the cursor in position x:0 y:0 that is the same effect of cls without fill the console with space characters.

cursor0.c (for tiny c)

Code: Select all

#include <windows.h>
#include <stdlib.h>

int main()
{
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    if ((hOut != NULL) && (hOut != INVALID_HANDLE_VALUE)) {
        COORD coord = {X: 0, Y: 0};
        SetConsoleCursorPosition(hOut, coord);
    }
    return 0;
}
For execute:

Code: Select all

tcc -run cursor0.c
Edit: For a windows 10 solution using escape sequences: viewtopic.php?f=3&t=9506#p61583
Last edited by carlos on 22 Mar 2020 09:22, edited 6 times in total.

miskox
Posts: 555
Joined: 28 Jun 2010 03:46

Re: Move Cursor to 0,0

#3 Post by miskox » 25 Feb 2014 12:58

This might help:

viewtopic.php?p=27602#p27602

Saso

Post Reply