0

I have one small program that creates windows and sql users called "login.exe"

I need a way to open the program, and click on the button "Create" and after X seconds close the program.

Is there any good way to do it? for example, execute the script every day at midnight, the program will open, click "Create" then waits 10 sec, and close the program.

It would be great if someone can help me with it because windows keep losing some users created after some time like every month I have to run that program.

  • 2
    There is no facility in pure batch files, i.e. command line interface, to interact with the GUI, you will need to leverage another language which provides this facility, Windows Script Host is one such option. – Compo Mar 22 '19 at 15:04

1 Answers1

0

@Compo is right, batch files cannot interact with the GUI but...you could use another language like c++ or even python to directly interact with the GUI and give you the same output in the very same console format that a batch file would. I would recommend using c# or C++ to do this because you could still execute command line operations just as you would within a batch file.

Zach Pedigo
  • 396
  • 2
  • 9
  • Can you tell me the "name" of the search that I have to do in order to find results about interaction with programs or something like that? it would be great because I have no clue what to search for. – Anoushka Iola Mar 22 '19 at 16:16
  • @AnoushkaIola,you didn't search for **batch file click button**? That is what I did and found the topic that I posted above. – Squashman Mar 22 '19 at 16:38
  • @AnoushkaIola you could start here -> https://stackoverflow.com/questions/2416748/how-do-you-simulate-mouse-click-in-c – Zach Pedigo Mar 22 '19 at 16:40
  • Please don't post answers on obviously off topic/bad questions! [See: **Should one advise on off topic questions?**](//meta.stackoverflow.com/q/276572) – double-beep Mar 22 '19 at 19:56