Can I write Cortana Skills to control my computer like change brightness or put my computer to sleep? - cortana

All the cortana bots seem to be sandboxed with limited capabilities. Is there any way I can write system files or chagne system configuration through these bots ?

for that kind of control you should create a UWP project and use Voice Command Definition API cortana skills are good for ordering pizza or book a flight, something that needs to be done over internet with a third-party API

Not without a Win32 Application that communicates with the Cortana Skill via the web.
What you can do is write script and but them in a folder under C:\ProgramData\Microsoft\Windows\Start Menu\Programs\
than you can run them like "Hey Cortana open custom script"

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!

Can I batch file upload videos on YouTube?

Recently, I've found myself doing a very long but repeated process of editing and uploading certain kind of videos online on YouTube. My friend suggested to write a batch file or a script as he said to help with the process, so I've decided to learn how to write it.
But first is that even possible? to write script file that open certain programs and do certain processes. And might open browser and click on certain buttons and make that?
Check out Youtube-upload
It's a command-line Python script that uploads videos to YouTube. It should work on any platform (OS X, Windows, etc) that runs Python. It is using the YouTube API V3.
If you are looking to automate the operation of Windows software. Look into AutoIt which provides a GUI and a simple basic-like scripting language to do so.

Can I interact with a Windows.Form application on a non-interactive desktop session?

I'd like to schedule a task that is a program that launches another program. The other program is a Windows.Form application.
Is it possible to programmatically interact with a Windows.Form application on a non-interactive desktop session?
Specifically, because I know this sounds very odd, I'd like to launch SpaceSniffer or something similar, and provide some interaction with it.
No, well it's not a good idea, anyway. Call a program with an API or a command line interface.

Administrative rights: Winforms vs WPF

I have been porting a Winforms app to WPF and have noticed the following regarding administrative rights.
The application launches a command line exeternal app as part of its execution using 'ProcessStartInfo'. The Winforms app has no application manifest and runs the app correctly.
However the WPF version won't launch the external app correctly UNLESS I give the WPF application administrative rights. ()
I'd prefer not to do this because of the somewhat annoying UAC confirmation dialog.
I've tried adding the 'ProcessStartInfo' Verb = "runas" but that has no effect.
Does anyone know why the Winforms version is OK but the WPF version requires admin rights? FYI. The external app process a file and writes the output file into a folder in the programdata directory)
It seems that external process launched from Wpf apps don't have access to the ProgrammData folder, although the parent app does. (Yes I do actually need to write to folders within PrgrammData. I have system services that need to consume data and these services have no knowledge of users...)
By having the external app write to Environment.SpecialFolder.ApplicationData and then have the parent app move the files from Environment.SpecialFolder.ApplicationData to programdata... things work as in the Winforms apps
Writing to Program Files is not advised. If you have control over those system services, modify them to take the data from Environment.SpecialFolder.CommonApplicationData folder, this location is not user-specific and shared across the system. Then your executable will write its output to Environment.SpecialFolder.CommonApplicationData.
Where ProgramData is located? If it's under Program Files, then both your WinForms and WPF applications should have administrator rights to write to it.

"Out of browser" web application running at Start-Up?

I've become familiar with the new concept of "out of browser" web applications, supported in the recent Silverlight, JavaFX, Adobe AIR etc.
Listening recently to a podcast on the subject by Scott Hanselman, I've become aware that one of the purposes behind these new architectures is to allow for "desktop-application-feel". Also, I understand some (or all) of these allow for some offline access to a sandbox of resources. This really sounds as if these frameworks could be an alternative to "real" desktop applications, as long as the application does not require messing with the user's machine (i.e. access to peripherals, certain file IO, etc).
I have a very specific question. My application needs to run at start-up. Is it possible to do so using such a framework without requiring the user to download and run a certain executable?
For example, I could always direct the user to download a small EXE that will put a .lnk file in the start-up directory, but I want to avoid such a patch.
To summarize: is it possible to have an out-of-browser web application setup itself to run at start-up without requiring file download?
To further clarify, this question does not come from an "evil" place, but rather from trying to decide whether "out-of-browser" frameworks are indeed a proper alternative to a desktop application, for my specific requirements.
The BkMark example here shows how to start an application on startup using Adobe Air. So, yes it is possible.
So, here's the deal: web apps in general will have a security context around them, and by default won't have access to write to the filesystem (outside of a temp files), access the registry, etc.
One way is, as you said, have the user run something or configure it so the lnk is executed on startup.
Another way, and I think, more in line of what you want, is that the user can run the program himself, click some button in the application, and it's configured.
I know with Java you could do this, but the user has to allow full access to their system, because your app would need to change System configuration. Then you could just configure it (by writing a lnk to your WebStart JNLP in the Startup folder)
For Internet Exploder, Javascript apps do have write access to the disk.
For other (better-secured) browsers you will either need to have a download, or Adobe AIR.
Assuming you are building for Windows, launching an executable at startup can be done several ways.
For user session startup, you can achieve this either by putting a lnk file in the appropriate folder, or with a registry entry. For operating system startup, you can achieve this with a registry entry. There are several permutations:
run application once on boot (UI not allowed)
run application every boot (UI not allowed)
start service every boot according to policy set in registry
run application once on user session start
run application every user session
Since an out of browser application has UI I expect you mean run application every user session and in this case you may as well put an LNK file in the user's startup folder.
I just created a shortcut for an SL4 OOB application, and this was the Target of the shortcut:
"C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe" 2635882436.localhost
A search of my disk revealed that location 2635882436.localhost is a folder.
C:\Users\<mylogin>\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser\2635882436.localhost
I rather doubt an OOB app of any type could place a shortcut in the Startup folder unless you somehow obtained Full Trust.

Resources