Question:
Automating windows file browser with batch commands?
The Walster
2011-02-23 19:49:37 UTC
I know this is probably a long shot but is it possible to automate a file browser using batch commands by passing text strings and simulating key presses?

I'm using a compiling program that bundles files. The program is initiated via a batch file, which then opens a window (not DOS) asking if you want to add a file (click yes/no) then an explorer file browser pops up asking you to choose a file and click open. Process repeats until all files are packed.

Is it possible to automate this process extending the batch file to pass the file path into the browser and simulate hitting enter.

I'm fairly sure the answer is probably going to be no, but I'm crossing my fingers and touching wood that I'm wrong.

Regards

The Walster
Three answers:
Aacini
2011-02-23 20:26:06 UTC
Sorry, the answer is No.



A core Windows applications feature is that they are event-driven, that is, they are designed to operate on mouse movement and clicks. As far as I know, there are no way that a DOS program (running in a Batch file) may simulate mouse movement and mouse button presses and/or key presses as input for a concurrent program.



However...



If your program is initiated via a Batch file, perhaps it may have another operation mode based on text input in DOS command style. To check this, open a DOS window and type the name of your program with /? after it.



Regards...
2011-02-23 20:21:09 UTC
You could write a program to watch that program's window for certain text or events, then find and click buttons, find and write into text boxes, etc. But not in a batch file.
Audrey
2016-04-27 08:58:33 UTC
The run line is for entering commands to do specific tasks that cannot be done any other way.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...