Created
January 30, 2016 01:53
-
-
Save ishu3101/df7967217c250f02d17e to your computer and use it in GitHub Desktop.
SendKeys Command To PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var o = new ActiveXObject("WScript.Shell"); | |
//Force x86 Version | |
o.Run("C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -windowstyle hidden"); | |
WScript.Sleep(5000); | |
o.AppActivate("powershell"); | |
o.SendKeys("Get-Process > output.txt {Enter}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment