Shiasu-sama
Shiasu-sama

Reputation: 1269

Execute options in "File" Context Menu with batch file

Is it possible with a batch file to open a file then execute or "click" an option in the opened application "File" menu with just one .bat file?

So for example normally I would double-click the Firefox shortcut on my desktop then click on "File" > "New Tab".

Is it possible to do that with a single .bat file?

Upvotes: 0

Views: 255

Answers (1)

wasif
wasif

Reputation: 15480

You can use the CursorPos.exe by @Aacini to move the cursor. Here is the download link: https://www.dostips.com/forum/viewtopic.php?t=3428. In the download page, you can only download the set of .exe files. Extract CursorPos.exe from them.

Usage: CursorPos [[±]col [±]row] If no parameter is given, return current cursor position as col+(row<<16) in ERRORLEVEL. If any coordinate have sign, the position given is relative to the current one. If cursor is moved, the Ascii code of the character at new position is returned in ERRORLEVEL.

And for mouse input you can use batbox.exe. Download link: https://batchprogrammers.blogspot.com/2016/06/batbox-awesome-batch-plugin-by.html?m=1. The full information is available there.

Upvotes: 1

Related Questions