windows automation and voice control using wake word - batch-file

I want to use a "wake word" with my windows 10 computer, instead of a hotkey, to run a custom windows automation command.
How can I setup windows to use a "wake word" and then run a custom command?
(Also how can I easily make a windows automation script to launch a program, or find the launched program, and send some keyboard keys and maybe mouse clicks?)

welcome! so it sounds like you want to do 3 things, so it should be 3 questions. If you edit these into 3 separate posts, then you might already find the answers, also. without needing to post. I guess the secret is to break down your complex problem into smaller problems first and try for yourself first. Then share what you tried.
OK, I break it down for you here:
Use voice control on windows (using cortana) with a "wake word" instead of hardware input device
https://www.laptopmag.com/articles/enable-hey-cortana-windows-10
Make a voice command run a custom Command (using cortana)
https://www.windowscentral.com/how-run-custom-commands-using-cortana-windows-10
you want to easily send keyboard and mouse commands by executing one custom command, check out these options as a sample
https://windowsreport.com/automate-pc-tasks/
Have a nice day, and you are not too far off from really getting the true benefits out of this site. Also if you break your questions down correctly, you will get upvotes and good reputation instead of a downvote from the people who check your question to see if its ok for use with this site. If you fix your question the downvote will be fixed by whoever did it, too.

Related

Intercept voice commands on Google Assistant or Alexa

I'm planning on doing an experiment, where we will setup a Google Assistant or Alexa device and see how people would interact with voice assistants in a certain environment. It's basically a Wizard of Oz experiment (https://en.wikipedia.org/wiki/Wizard_of_Oz_experiment). Is it possible to intercept the voice commands before they get passed to the Assistant or Alexa? This could help me decide/manage if I want to handle the user input or let Google/Alexa handle it.
Will you be using a purchased "original" device or will you use, e.g. an Raspberry PI and build it yourself?
For the former this won't be possible out of the bow. However, I recently stumbled upon an article. It describes a new device which would achieve something that might help you: It allows you to "reprogram" the activation word for Alexa and Google Assistant. The article mentions that the device's hardware is a Raspberry PI. So, I guess you could build something similar yourself. That was also the first idea that came into my mind.
I would imagine something like this:
On your raspberry you have a script (I guess written in python would be easiest) that listens for the wake-word, e.g. "Alexa" and also records the following voice. However, you have Alexa itself not running for now, so it doesn't get triggered. Your script also includes a logic for when to pass the command on to Alexa or what to do with it instead. When it decides that the command is to be passed on, the script starts Alexa and replays the recording. Thus, triggering it the same way the users would have triggered it, in the first place.
Another idea would be to use two microphones. One for your script and one for Alexa. Your script having the ability to mute/unmute those.
Pleas take into account that those are just spontaneous ideas. It's completely possible that I've missed something and this wouldn't work. But until somebody who has done this before comes up, I'd give it a try!

How to i make a .bat that targets a program and types in a text box

I have no idea where to start on this one. I have seen answers that are like this but I don't know how to format them for what I want. I just need to target the minecraft server while its open and close it by typing "stop" in the console. I have no code to show for but this will be in a other file so I can launch it and then have it close the program. btw I don't think I can use taskkill But anything will help ;) thankyou very much!
This is not possible using a batch file alone. There are two main ways to get input to another program in the system (in this case, java.exe):
Get your program to listen for a special signal. There are several administrative plugins for Minecraft which will run in the Java process and will do what you need.
Spoof user input to the program. In the case of a console app, you would probably use a SendKeys() based solution. See How to send input to the console as if the user is typing for some examples.
In the case of Minecraft, I think the first solution is going to be significantly easier, because the modding community has already supplied a number of solutions to this exact problem. #Frxstrem recommended mcrcon, which I suppose is as good a solution as any.
Most probably the console client you are using is scriptable and this is not good aproach.
Any way here's a sendKeys.bat. You can use it like:
call sendKeys.bat "Minecraft console title" "stop{enter}"
Batch files can't do this without calling out to something else; if you're going to call to something else, use AutoHotkey - that's what it's good at.
WinActivate "the title of the Minecraft server window"
https://www.autohotkey.com/docs/commands/WinActivate.htm
Send stop{Enter}
https://www.autohotkey.com/docs/commands/Send.htm

multiple run and automatic response for each run in batch file

I am creating a batch file to run a software several times. Each time the software is executed, a window with two choices will appear, and the default is just clicking enter. I don't want to click enter for each run, so I would like to write an automatic answer in my batch file. Is it possible?
The basic answer to your question is no.
However, with the help of the software you are launching, or an external tool, you might be able to achieve this.
If this other software accepts parameters, then maybe it provides one to automatically answer that first dialog that pops up.
Otherwise, you can use tools such as AutoIt to simulate a user click in the dialog.
Piping a carriage return works for some programs - that technique depends on the tool.
So see if this works for your program.
echo.|"c:\folder\filename.exe"

Prevent Mac Laptop from sleeping when closed?

I'm writing a program in C and want it to have an option that will keep a mac laptop awake even if the lid is closed so processes can continue. There seems to be very little information available on this topic so I really don't know where to begin. If anyone knows how to accomplish this or where I can find more information I would really appreciate (i.e. will I need to work with the BIOS for this or are there built in functions?). Also, if it's easier to do it in another language that is fine as I'm not stubbornly set on using C.
You need to write a kernel extension for this. The OS doesn't support it by default because the laptops aren't designed to properly cool themselves with the lid closed and internal display enabled. SleepLess is a $10 utility that'll do what you want, too. If you warp the display or something, it's your own fault. :-).
If you want to write something yourself, LidSleep.kext looks like a good start (it does the opposite, i.e. sleeping on lid close) and comes with source code.
(It is possible and supported to wake up some Mac laptops with the screen closed by using an external input device.)
You can do this using the I/O Kit framework, see QA1340 listing 2 for sample code using IOPMAssertionCreateWithName to temporarily prevent sleep.
The link to LidSleep.kext listed above is not working, so I can inform that the author of NoSleep has made the source code available here, so you can see for yourself how it can be done:
https://code.google.com/p/macosx-nosleep-extension/
If your laptop is a reasonably recent model, you don't need to add anything. If you are running Lion, it simply works. If you're running an older OS you have to wake up the laptop by sending it a keystroke or mouse click from an external keyboard or mouse. See http://support.apple.com/kb/ht3131

prevent screen capture

i am developing a video player i silverlight
i wanna something to prevent recording or screen capturing
i thought about hacking the windows APIs and stop my program from running if there was any of those capturing software asking the user to close it first but i donno how to do this
is there another solution ??!!!!
It's simple not possible. If you try it, you're only going to annoy people.
Even 'hacking the windows API' would not work, since the OS itself could be run inside a VM.
I hate to be a downer, but task is impossible to fully accomplish.
If you were somehow able to hook the keyboard (from a silverlight app no-less) I would certainly hope that whatever AV the user is running would throw up some red flags.
Also what if the user doesn't use the standard (alt)+prtscr? A third-party tool might use a different key-combo. Also, I've written a screen-grabber with the GDI+ API, and there's no way to disable something that low-level.
What about attached capture-cards? What if your app is running in a VM or over remote-desktop?
If you are that deeply concerned about protection your HD content, watermark it, or make the user pay for it first.
All-in-all, as soon as your content's data enters your user's computer, they can duplicate it.
You could go about using a key hook system, stopping the user pressing the print screen key on the keyboard, that would be a start. There aren't many systems which stop users from print screening video specifically. You might want to try just watermarking your video instead? At least then people know that the video was originally sourced from you.
The solution is not to allow your application to run on a computer, but instead target a device such as a phone. Computers will always allow some kind of screen capture and video capture but this is much harder and less likely to be tackled if you restrict to only playing on certain devices.
How badly do you need this? There are many ways to defeat screen capture protection: for instance, aiming a video recorder at the computer screen (or looping output to a TV with a capture card, etc. etc. etc.)
Go for a commercial solution if you really really need this: don't have any experience with those myself, however.

Resources