Autohotkey colour/image bot on vps? - autohotkey

I'm runnings ahk scripts on a vps. It uses colour and images to perform tasks. The problem is I've to be connected through remote desktop 24/7 and keep the RD client in focus for it to work. As soon as I minimise/disconnect the remote desktop, the script stops working (pauses).
I know there's no monitor attached in the vps. I need a workaround to this please.
Thank you.

Related

Autohotkey on a remote desktop does not work when I disconnect my local desktop

Im am using Autohotkey to rerun Pytest every ten minutes on a Virtual machine offered my Microsoft Azure.
My .ahk script is simple.
loop
{
Send !{F10}
Sleep, 600000
}
The script works perfectly while Im connected to the remote desktop. But if I exit the full screen or disconnect from it., it does not work. The Autohotkey keeps on running but for some reason just does not register Send !{F10}.It only starts registering it when I connect back on it. Please help.
Autohotkey not functioning properly on minimized virtual machines is an issue that's been around for a while, with
(regarding Virtual Machines):
RemoteAdmin server process launches a program on request of remote
user (you). So R.A. is a parent process for AHK. Once you minimize
your RA session client it signals the RA-server that. RA-server thinks
now that since the client is minimized it does not need anything and
to consume CPU power it halts any activity of itself and its child
processes.
-wOxxOm
And in the documentation of other AHK functions, such as WinActivate
Known issue: If the script is running on a computer or server being
accessed via remote desktop, WinActivate may hang if the remote
desktop client is minimized. One workaround is to use commands which
don't require window activation, such as ControlSend and ControlClick.
Another possible workaround is to apply the following registry setting
on the local/client computer:
; Change HKCU to HKLM to affect all users on this system.
RegWrite REG_DWORD, HKCU, Software\Microsoft\Terminal Server Client
, RemoteDesktop_SuppressWhenMinimized, 2
^^The above registry change may potentially solve your issue as well^^
The forum thread provides a couple of different workarounds for this issue, but if you are just trying to put the VM out of the way while you do other stuff on your computer, the least gimmicky solution that I can think of would be to move the Virtual Machine window on the host computer to a Virtual Desktop by either using the Win+Tab shortcut or by using this guide. By moving the window to a virtual desktop, the Virtual Machine will moved out of the way in a manner where it would not be minimized, allowing it to continue running the AHK script. Additionally, you can quickly navigate between Virtual Desktops with the Ctrl+Win+← and Ctrl+Win+→ shortcuts.

usb local and remote port configuration via cmd batch

(xpost from superuser with no answers.)
I am trying to reconfigure a known (virtual?) com port on multiple computers on a local network using a batch file.
A USB device we use is installed always as com9 and always comes in as default 9600 baud, and we have to manually reconfigure each station to 57600 baud.
I already have this batch file renaming printers, dns servers, Killing and starting tasks, copying files and a whole lot more, I've experimented with mode, but I'm either not using it properly or it can't do what I want.
I know I can use the GUI, but for the sake of speed, I want the batch to do it.
Sorry if this is a copy, but I'm seeing if anyone has an angle for me, I'm not afraid of personal research, but I'm running into dead ends with no leads.
Ask if you need any clarifications, and thanks in advance.
Powershell is okay too if I know what I need and can still stay in the cmd environment.

Connect to console app running as a system task on Windows server

I run several game servers on a single windows-server-2012-r2. Many of the game servers run as console-application. I have created scheduled-tasks to run each on windows startup even if I'm not logged on. I would like to be able to attach to the consoles of those apps when logged on to the server, similar to what can be done in linux. Perhaps I'm going about this in the wrong way. Is there a way to attach to console apps running as tasks? Is there a software tool that accommodates this sort of thing?
Update:
Been searching high and low for a solution but haven't found anything yet. Have decided to write a wrapper for console app that will redirect Stdin, Stdout and Stderr of a process to a Telnet connection. Will use nssm to run the wrapper as a service.
I produced a solution: https://github.com/ccourson/Banjo
Banjo will launch a specified console application and route its streams to and from a telnet connection.
Pull requests welcome.

Run batch file on remote pc *visibly* to logged on user

I've got a batch file dmx2vlc which will play a random video file through VLC-Player when called.
It works well locally but I need this to happen on another machine on the network (will be adhoc) and the result (VLC-Player playing the video) must be visible on the remote screen.
I've tried SSH, Powershell and PsExec, but both seem to run the batch file and the player in the session of the command line, even when applying a patch to allow multiple logins.
So IF I get to run the batch file it is never visible on screen.
Using Teamviewer and the like is no option as I need to be able to call all this programmatically from my dmx program.
I'm not bound to being able to call the batch directly, it would be sufficient for me if I could somehow trigger it to run.
Sadly latency is a problem here as we are talking about a lighting (thus dmx) environment.
Any hints would be greatly appreciated!
You can use PSexec if the remote system is XP with the interactive parameter if you state the session to interact with, 0 would probably be the console (person physically in front of the machine).
This has issues with Windows Vista and newer as it pops up a prompt to ask the user to change their display mode first.
From memory, you could create a scheduled task on the remote system pretty easily though and as long as it's interactive the user should see it.
Good luck.
Try using web interface. It is rather easy: VLC is running http server, and accessing particular URL from remote machine will give full control over VLC. Documentation can be found here

Test Automation tool not running via Windows Task Scheduler

Here is a general description of the issue which I cannot solve:
We have a WindowsServer 2008 R2 system that is used to running the install of our product(using powershell script), and then the Powershell script calls the .exe of our UI test automation tool (Ranorex).
The install of the product works fine, but the UI automation portion only runs if some is physically logged in via remote desktop.
If the remote desktop session is closed (but the programs continue to run..so user is technically logged in), the UI automation portion will NOT run.
The options I selected on the General tab of the job are:
-Run only when the user is logged in;
-Run with highest privileges;
Any ideas on from anyone who has had this issue and got it to work would be extremly helpful.
Thanks,
Eric
UI operations are usually in suspended state when a user is disconnected from an RDP session. Use a tool like VNC or equivalent where you have access to the main console for these UI operations to remain active.