user8385393
user8385393

Reputation: 104

How can I send ALT+ENTER using Powershell?

Using PowerShell, I'd like to make the program full screen when the program is run, without being windowed. Pressing ALT+ENTER allows the program to be full screen when the program is run. Here is what I have so far:

add-type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("ENTER%")

Here is a resource from Microsoft that will REALLY help you. https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys.send?redirectedfrom=MSDN&view=netframework-4.8

All I want to do is to send the combination ALT+ENTER using PowerShell. Please no other languages unless it's batch, and I don't want an alternative.

Upvotes: 1

Views: 972

Answers (1)

justsomeguy
justsomeguy

Reputation: 559

You'll need to use:
% for alt
and
~ for enter

yourapplication.SendKeys('%~')

Reference: https://learn.microsoft.com/en-us/previous-versions/office/developer/office-xp/aa202943(v=office.10)

Upvotes: 2

Related Questions