Open the start menu using Powershell

1

Am currently working on a business process automation software and literally user actions are simulated by robots. I need to pass some information to the start menu of my windows 7 and i was wondering if the windows start menu could be opened using a powershell script? As the information to open a powershell can be understood by the robots. Please any suggestions would be nice.

Siobhan

Posted 2016-05-03T11:49:59.770

Reputation: 193

Answers

3

Yes, it is possible using a little VB.

Copy this code into Notepad, and save as startmenu.vbs. [Make sure it doesn't get saved as startmenu.vbs.txt]

set wShell=wscript.createobject("wscript.shell")
wShell.sendkeys "^{ESC}"
Set WshShell = Nothing

Then, you can just run it with cscript C:\somefilepath\startmenu.vbs.

(Obviously, you'll have to specify the path where you save it to)


Or, translated to a Powershell solution:

$wShell = New-Object -ComObject "wscript.shell"
$wShell.SendKeys("^{ESC}")

Which can be further shortened to:

(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")  

You'reAGitForNotUsingGit

Posted 2016-05-03T11:49:59.770

Reputation: 614

2Translated to powershell: $wShell = New-Object -ComObject "wscript.shell"; $wShell.SendKeys("^{ESC}") – Lieven Keersmaekers – 2016-05-03T12:25:20.100

2or shortened as (New-Object -ComObject "wscript.shell").SendKeys("^{ESC}") – Lieven Keersmaekers – 2016-05-03T12:26:23.980

@LievenKeersmaekers You should put that in as an answer (with a brief explanation of what it's doing). :) – Ƭᴇcʜιᴇ007 – 2016-05-03T12:36:08.103