Controlling another computer (Remote)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Controlling another computer (Remote)

09 Sep 2017, 08:34

Hi guys,

My main PC (which should control the other PC) uses Windows 7 Pro 64 Bit.
The other PC (a tablet) uses Windows 8.1 32 Bit.
Both PCs are in the same local area network.

I would like to execute AHK scripts on the tablet by using keystrokes on my main PC.
The first tries were with PsExec and batch files (to check if it generally works).
It worked, but it's neither comfortable nor fast (almost takes 20 seconds...)

For this reason I think AutoHotKey might be a better solution.

What I've already done:
- I downloaded the following scripts on both PCs:
- AHKFile.ahk, AHKsock.ahk, AHKClient.ahk (main PC), AHKServer.ahk (tablet)
- on both PCs all the files are located in the same directories
- in the client and server ahks I uncommented the lines
- ;Include %A_ScriptDir%\AHKsock.ahk
- ;Include %A_ScriptDir%\File.ahk

From what I understood, I must first convert and execute the AHKServer.ahk on my tablet.
After this, I have to open the AHKclient on the main PC and specify the ip + port + script place of the tablet.
If I have 5 different scripts on my tablet, which I want to execute (not all at once),
this means I have to create 5 different AHKclient.ahks on the main PC.

Everything correct so far?
I'd like to ask before I mess up something.
Even though I read the codes, I must honestly say it's difficult for me to understand it.
(My knowledge isn't good.)

Thanks for any help!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Controlling another computer (Remote)

09 Sep 2017, 08:43

You only need one client, the client just needs to be a script that can start the rest.
Please excuse my spelling I am dyslexic.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Controlling another computer (Remote)

09 Sep 2017, 09:32

I was able to trigger scripts on my pc from my android device using MyControl (unfortunately not the other way around). With Sock.ahk you should be able to do it via TCP/IP and (the even faster) UDP.
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Controlling another computer (Remote)

10 Sep 2017, 16:26

Hi,

I made a first test and on my main PC (the Client) I receive the following error when launching the AHKClient.exe:
Image

Does this error belong to the AHKClient or to AHKsock.ahk?
The 26th line of the AHKsock.ahk is

Code: Select all

8: The WSAAsyncSelect() call failed. The error is in ErrorLevel.
P.S. On the tablet the AHKServer.exe is running of course - with Windows firewall permission "private network".

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Controlling another computer (Remote)

11 Sep 2017, 19:08

Hello guys,

Is anybody here actually using the AHKRemote scripts?
If yes, can you give me an example of what you changed in your codes in order to let it work?
Maybe I made some mistakes.

When I start the AHKServer.exe on my tablet, I can see an HDD shortcut in the taskbar.
After I click on it, I see:
- No Connection (grey)
- Reload
- Exit

Since there isn't a connection between both devices yet (due to the error message in post #4),
it's logical that it says "No Connection".
So my first idea is that the AHKServer.exe seems to work, but the AHKClient.exe not.

Thanks for any help!

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Controlling another computer (Remote)

12 Sep 2017, 08:27

Hi guys,

Okay, I made some further progress.
I replaced the existing server and Client scripts by these ones:
https://autohotkey.com/board/topic/2635 ... e-control/
(For the client ahk I needed to choose ANSI 32-Bit, otherwise I received a Winsock error when running the compiled exe.)

After starting the AHKserver.exe on the tablet and the AHKclient.exe on the PC both devices are connected!
(If I turn off my tablet for test purposes, it says "192.168.0.4 cannot be reached" when running the AHKclient.exe on the PC)

For my next test I'm trying to create a script (AHKTabletTest.exe) which simply opens Calc.exe on my tablet.
Its code is:

Code: Select all

Run, "%A_AhkPath%" "<C:\Users\#USER#\Documents\AutoHotKey-Scripts\AHKClient.ahk>" 192.168.0.4:8257 C:\Users\#USER#\Desktop\AHK-Scripts\RunCalc.ahk
After executing AHKTabletTest.exe, only the folder C:\Users\#USER#\Documents\AutoHotKey-Scripts\ gets opened.
I hope it's just a tiny mistake...
Can you give me a hint, please?

P.S.
I got the original code from here:
https://autohotkey.com/board/topic/5440 ... ers-tcpip/

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], macromint, peter_ahk, Spawnova and 268 guests