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

@ThunderSniper ThunderSniper commented Sep 28, 2016

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

@ritchielawrence ritchielawrence commented Sep 28, 2016

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.

@ritchielawrence ritchielawrence self-assigned this Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.