38 lines
1.7 KiB
Batchfile
38 lines
1.7 KiB
Batchfile
@echo off
|
|
|
|
echo Beende und deinstalliere pcvisit...
|
|
:: 1. Stoppt alle pcvisit Dienste und Prozesse hart
|
|
powershell -Command "Stop-Service -Name '*pcvisit*' -Force -ErrorAction SilentlyContinue; Get-Process -Name '*pcvisit*' -ErrorAction SilentlyContinue | Stop-Process -Force" >nul 2>&1
|
|
|
|
:: 2. Sucht den Uninstaller in der Registry und führt ihn silent (/S) aus
|
|
powershell -Command "$u = (Get-ItemProperty 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -match 'pcvisit' }).UninstallString; if ($u) { $u = $u -replace '\"',''; Start-Process -FilePath $u -ArgumentList '/S' -Wait -NoNewWindow }" >nul 2>&1
|
|
|
|
:: Kurze Pause, damit die Deinstallation saubere Verhältnisse hinterlässt
|
|
ping 127.0.0.1 -n 5 >nul
|
|
|
|
|
|
echo Lade RustDesk herunter...
|
|
powershell -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri 'https://me-files.vmd55888.de/me-rustdesk-host.exe' -OutFile 'C:\TMP\rustdesk_installer.exe' -UseBasicParsing"
|
|
|
|
:: 2 Sekunden warten (Ping-Trick)
|
|
ping 127.0.0.1 -n 3 >nul
|
|
|
|
|
|
echo Erstelle saubere Admin-Umgebung via Taskplaner...
|
|
schtasks /create /tn "RustDesk_Setup" /ru "SYSTEM" /rl HIGHEST /tr "C:\TMP\rustdesk_installer.exe --silent-install" /sc once /st 00:00 /f >nul 2>&1
|
|
|
|
echo Starte Installation...
|
|
schtasks /run /tn "RustDesk_Setup" >nul 2>&1
|
|
|
|
:: 15 Sekunden warten (Ping-Trick)
|
|
ping 127.0.0.1 -n 16 >nul
|
|
|
|
|
|
echo Raeume Task wieder auf...
|
|
schtasks /delete /tn "RustDesk_Setup" /f >nul 2>&1
|
|
|
|
echo Entferne Desktop-Verknuepfung...
|
|
del "C:\Users\Public\Desktop\ME-RustDesk-Host.lnk" /Q /F >nul 2>&1
|
|
|
|
|
|
echo Fertig! |