Remote Desktop shorcut and powershell

Yunho Kwon 0 Reputation points
2024-11-05T20:20:08.3466667+00:00

Hi team,

I'm attempting to automate the activation of the Remote Desktop Connection bar using the keyboard shorcut Ctrl + Alt + Home.
I've created a Powershell script and C# code that utilises keybd_event function from user32.dll library to simulate key processes.

Codewise it's all working fine as it's working for Ctrl + A, Ctrl+V etc, but when I try to use Ctrl+Alt+Home or other Remote Desktop shortcuts, it's not working.

Are there any known restrictions to simulating these shortcuts in Powershell or other coding languages? Also are there any best practices or alternative methods you would recommend for reliably simulating this shortcut (apart from using a 3rd party software)?

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,608 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,608 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jacen Wang 965 Reputation points Microsoft Vendor
    2024-11-08T15:18:41.66+00:00

    Hello,

    Thank you for posting in the Microsoft Community forum.

    It looks like you're having a problem triggering remote desktop shortcuts using an automated script. May I know if the remote desktop responds properly when you manually output Ctrl + Alt + Home shortcuts from the keyboard?

     

    The default key combinations will work on whichever machine has the full desktop; functionally, this means that the default key combinations work for the local machine, unless you have the Remote Desktop Connection window in full-screen mode.

     

    Reference:

    Remote Desktop Services Shortcut Keys - Win32 apps | Microsoft Learn

     

    Best regards

    Jacen

    ——————————————————————————————————

    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.