Hi all,
This is my first subject in this forum, so please bare with me if I make any mistake
I want to make a batch that runs as a background task and checks every now and then for specific syntax in windows clipboard, if it finds a matching word, it executes a program.
Example:
the word we are seeking has the form WORDXXX, so I want whenever I copy a word that matches WORDXXX (like WORD123, WORDxyz or WORDEEE), I want an executable to be run.
The algorithm sounds to me like:
While (true)
{
while (true)
{
check clipboard for text matching WORDXXX
if (match == true) then execute "c:\program.exe"
}
}
The main hardships I am encountering are:
1/ how to check the clipboard for text
2/ how to implement the RegEx that checks the text in clipboard to find if it matches the WORD
Any help will be greatly appreciated
Kind regards,
Russs
Batch to launch aprogram based on specific word in clipboard
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Batch to launch aprogram based on specific word in clipb
Mmm are you familiar with DOS batch? I think you might have the wrong idea about it like a lot of people (that it can do anything like magic). It relies on command line tools for most things. Usually such tools aren't made for the command line because it would be silly to have some roundabout reliance on DOS batch.
Anyways, clipboard data is stored in Windows system memory, so unless you can access that object you can't do it. WMIC might be able to do it, but that's all I can say.
http://ss64.com/nt/wmic.html
Anyways, clipboard data is stored in Windows system memory, so unless you can access that object you can't do it. WMIC might be able to do it, but that's all I can say.
http://ss64.com/nt/wmic.html