Start creating with Reallusion AI Services for free. Choose the plan that best fits your needs, with a unified AI Points system that works across AI Studio, Video Mocap, and Headshot Image Generation.
See the official webpage.
2D, 3D, game, games, online game, game development, game engine, programming, OpenGL, Open AI, math, graphics, design, graphic, graphics, game development, game engine, programming, web development, web art, web graphic, arts, tutorial, tutorials,
# Run first
# Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
# --- Create Form ---
$form = New-Object System.Windows.Forms.Form
$form.Text = "Python Path Fixer"
$form.Size = New-Object System.Drawing.Size(500, 300)
$form.StartPosition = 'CenterScreen'
# --- Label & Path Input ---
$label = New-Object System.Windows.Forms.Label
$label.Text = "Python Directory:"
$label.Location = New-Object System.Drawing.Point(10, 20)
$label.AutoSize = $true
$form.Controls.Add($label)
$txtPath = New-Object System.Windows.Forms.TextBox
$txtPath.Location = New-Object System.Drawing.Point(10, 45)
$txtPath.Size = New-Object System.Drawing.Size(460, 20)
$txtPath.Text = "C:\PythonInstall"
$form.Controls.Add($txtPath)
# --- Log Box ---
$txtLog = New-Object System.Windows.Forms.TextBox
$txtLog.Multiline = $true
$txtLog.ScrollBars = 'Vertical'
$txtLog.Location = New-Object System.Drawing.Point(10, 80)
$txtLog.Size = New-Object System.Drawing.Size(460, 130)
$txtLog.ReadOnly = $true
$form.Controls.Add($txtLog)
# --- Fix Button ---
$btnFix = New-Object System.Windows.Forms.Button
$btnFix.Text = "Check and Fix Path"
$btnFix.Location = New-Object System.Drawing.Point(10, 220)
$btnFix.Size = New-Object System.Drawing.Size(460, 30)
$btnFix.Add_Click({
$pythonFolder = $txtPath.Text
$pythonExe = Join-Path $pythonFolder "python.exe"
$txtLog.Text = "Checking: $pythonExe`r`n"
if (Test-Path $pythonExe) {
$txtLog.AppendText("[+] Python found. Updating PATH...`r`n")
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
$pathParts = $currentPath -split ";" | Where-Object { $_ -ne $pythonFolder -and $_ -ne "" }
$newPath = "$pythonFolder;" + ($pathParts -join ";")
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
$txtLog.AppendText("[OK] Priority set successfully!`r`nPlease restart your terminal.")
} else {
$txtLog.AppendText("[ERROR] python.exe not found in the specified directory!")
}
})
$form.Controls.Add($btnFix)
[void]$form.ShowDialog()