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.


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"

Which can be further shortened to:

(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")  
  • 2
    Translated to powershell: $wShell = New-Object -ComObject "wscript.shell"; $wShell.SendKeys("^{ESC}") – Lieven Keersmaekers May 3 '16 at 12:25
  • 2
    or shortened as (New-Object -ComObject "wscript.shell").SendKeys("^{ESC}") – Lieven Keersmaekers May 3 '16 at 12:26
  • @LievenKeersmaekers You should put that in as an answer (with a brief explanation of what it's doing). :) – Ƭᴇcʜιᴇ007 May 3 '16 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.