User Tools

Site Tools


script:powershell:temp:retroarch

DO{

$process = 'retroarch.exe'
$CommandLine = (Get-CimInstance Win32_Process -Filter "name = '$process'").CommandLine
$CommandLine.split('"') | ForEach-Object {

if ($_ -match 'roms'){Set-Variable -Name Line -Value $_}

}
$SelectTheme = ($Line.Split('\\') | ForEach-Object { Get-ChildItem -Path 'G:\GAMES\RetroBat\emulationstation\.emulationstation\themes\nextfull' -Filter $_ -ea SilentlyContinue}).FullName
Get-ChildItem -Path $SelectTheme -Filter system.png -Recurse

} While ((Get-Process retroarch -ea SilentlyContinue).Responding) {sleep -Milliseconds 100}

if (!(Get-Process retroarch -ea SilentlyContinue).Responding) {
    Stop-Process firefox
    Start-Process firefox
    }
}

$target = "retroarch"
$process = Get-Process | Where-Object {$_.ProcessName -eq $target}
while ($true)
{
while (!($process))
{
$process = Get-Process | Where-Object {$_.ProcessName -eq $target}
start-sleep -s 5
}
if ($process)
{
Write-Output "Process Start"
$process.WaitForExit()
start-sleep -s 2
$process = Get-Process | Where-Object {$_.ProcessName -eq $target}
Write-Output "Process Exit"
}
}

script/powershell/temp/retroarch.txt · Last modified: 2020/08/10 23:07 (external edit)