#Is there any way to press the tab key in a Powershell Script?

1 messages · Page 1 of 1 (latest)

faint dragon
#

Pls help

glossy turtle
#

Tap? or <TAB>?

#

One way is the Wscript.Shell way and SendKeys.

faint dragon
#

Tab

#

I'm dumb

#

Sorry

glossy turtle
#

So you got it?

faint dragon
glossy turtle
#

so have you researched wscript.shell or sendkeys?

visual berry
#

There's two primary methods: one involves using wscript.shell and sendkeys as @glossy turtle suggested, while the other involves loading the System.Windows.Forms assembly. I suggest researching these two options and determining which is best for your scenario.

floral mural
#

Is there any way to press the tab key in a Powershell Script?

#

And it will literally type Write-H and then press the TAB button

#

(into the same PowerShell window where you ran it, since you didn't tell Send-Input to send it somewhere specific)

#

It's a pretty cool feature, if I do say so myself 😉

#

And you can mix and match keyboard and mouse input ...