Attached "run"Script i.e. "Run, *runas %ComSpec%", does not work on Remote PC (via Anydesk/TeamViewer)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vikasgandhi
Posts: 32
Joined: 03 Jul 2021, 20:28

Attached "run"Script i.e. "Run, *runas %ComSpec%", does not work on Remote PC (via Anydesk/TeamViewer)

Post by vikasgandhi » 20 Mar 2023, 07:19

The following script (script to open window for " Elevated Command Prompt" ) works on my pc, but it does not work on remote pc, that we access through AnyDesk or TeamViewer
in my case situation is different, the script prepared by me opens "Elevated Command Prompt" window on my computer. But, it is not working on remote host i.e. it is not able to open "Elevated Command Prompt" windows of the computer which is accessed from AnyDesk.
Is there any way, to make it work on remote PC as well (which we access through AnyDesk/TeamViewer).

Code: Select all

#SingleInstance Force
SetWorkingDir %A_ScriptDir%
if not A_IsAdmin
	Run *RunAs "%A_ScriptFullPath%" ; (A_AhkPath is usually optional if the script has the .ahk extension.) You would typically check  first.

^t::
Run, *runas %ComSpec%
[Mod edit: Moved topic to AHK v1 help, based on posted code.]

Return to “Ask for Help (v1)”