Posted by: Trekkie1985
« on: November 05, 2020, 01:27:17 PM »Can you help me via AnyDesk? I have multiple errors.
Sry for my bad english. German is my native language.
AnyDesk is a Teamviewer alternative.
This is the content of the StartAurora. ps file. I have modified it as I should:
The Content of properties and and target is:
C:\Windows\System32\WindowsPowerShell\v1. 0\powershell. exe -ExecutionPolicy ByPass -File C:\Users\AKint\Desktop\StartAurora. ps1
Sry for my bad english. German is my native language.
AnyDesk is a Teamviewer alternative.
This is the content of the StartAurora. ps file. I have modified it as I should:
Code: [Select]
$gamePath = "C:\Aurora4xC#"
$dateFormat = "dd, mm, yyyy"
$decimalFormat = ","
$thousandFormat = "."
$delayBeforeExitInSeconds = 30
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Windows {
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, System.Text.StringBuilder text, int count);
}
"@
$originalDateFormat = $null
$originalDecimalFormat = $null
$originalThousandFormat = $null
try
{
$originalDateFormat = Get-ItemProperty -Path "HKCU:\Control Panel\International" -Name sLongDate
$originalDecimalFormat = Get-ItemProperty -Path "HKCU:\Control Panel\International" -Name sDecimal
$originalThousandFormat = Get-ItemProperty -Path "HKCU:\Control Panel\International" -Name sThousand
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sLongDate -Value $dateFormat
Write-Host ("Date format set to " + $dateFormat)
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sDecimal -Value $decimalFormat
Write-Host ("Decimal format set to " + $decimalFormat)
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sThousand -Value $thousandFormat
Write-Host ("Thousand format set to " + $thousandFormat)
$game = Start-Process -PassThru -WorkingDirectory $gamePath -FilePath ($gamePath + "Aurora.exe")
$gameWindow = $game.MainWindowHandle
do
{
Start-Sleep -Milliseconds 100
$game.Refresh()
if ($game.HasExited -eq $true)
{
break
}
if ($game.MainWindowHandle -ne 0)
{
break
}
} while ($true)
Start-Sleep -Seconds $delayBeforeExitInSeconds
}
finally
{
if ($originalDateFormat -ne $null)
{
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sLongDate -Value $originalDateFormat.sLongDate
Write-Host ("Date format set to " + $originalDateFormat.sLongDate)
}
if ($originalDecimalFormat -ne $null)
{
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sDecimal -Value $originalDecimalFormat.sDecimal
Write-Host ("Decimal format set to " + $originalDecimalFormat.sDecimal)
}
if ($originalThousandFormat -ne $null)
{
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sThousand -Value $originalThousandFormat.sThousand
Write-Host ("Thousand format set to " + $originalThousandFormat.sThousand)
}
}
The Content of properties and and target is:
C:\Windows\System32\WindowsPowerShell\v1. 0\powershell. exe -ExecutionPolicy ByPass -File C:\Users\AKint\Desktop\StartAurora. ps1