Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting a Window Based on Image #5

Closed
ThunderSniper opened this issue Sep 28, 2016 · 1 comment
Closed

Selecting a Window Based on Image #5

ThunderSniper opened this issue Sep 28, 2016 · 1 comment
Assignees
Labels

Comments

@ThunderSniper
Copy link

Is the above possible? If I have two windows open both named "CRAZY WINDOW NAME" one being a program/executable and another being "explorer", is it possible to just target the explorer window and leave the program/executable alone?

@ritchielawrence
Copy link
Owner

You can filter Cmdow's output with FINDSTR and a regular expression:-

for /f %%a in ('cmdow /b ^| findstr "explorer.*CRAZY WINDOW NAME"') do (
  cmdow %%a /act
)

Note the pipe character (|) has been 'escaped' using a carat (^). Adjust the options in the second use of Cmdow to suit your requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants