From f68227d1762dbba08534031da56661ba8e70ff01 Mon Sep 17 00:00:00 2001 From: Umut <77373632+sasprosko590@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:44:40 +0300 Subject: [PATCH] Add files via upload --- AUTHORS.md | 1 + CHANGELOG.md | 2 + README.md | 1 + SASPClean.ps1 | 198 ++++++++++++++++++++++++++ SECURITY.MD | 2 +- package.json | 2 +- start.bat | 381 +------------------------------------------------- 7 files changed, 209 insertions(+), 378 deletions(-) create mode 100644 SASPClean.ps1 diff --git a/AUTHORS.md b/AUTHORS.md index 075beff..3378ed0 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,3 +1,4 @@ # AUTHORS Sasprosko/Umut +Wosy diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d90714..e8d81ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # CHANGELOG +Version V1.0.1 = Statistics updated. `start.bat` updated. Added `SASPClean.ps1` and added icon for it. Added `SASPClean.ps1` and added icon for it. AUTHORS.md updated. + Version V1.0.0 = Added colored text (I don't know how to add it for cmd). Edited file deletion. Hacker control was added to index.test.js because it was forgotten to be added. Version V0.0.9 = Edited "winget upgrade --all" because it was misspelled and changed to "winget upgrade --all" diff --git a/README.md b/README.md index c0318cb..300ea72 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This script was created to restore the computer to the fast, pure and tidy perfo ### Notes +- The translations may not be correct because I translated them with a translation program. I apologize in advance. - I don't have any bad intentions, there is no bad software in the code, and there is no such thing as taking the user's name in the code. - Update your drivers. - Close unnecessary startup programs in the task manager. diff --git a/SASPClean.ps1 b/SASPClean.ps1 new file mode 100644 index 0000000..c39d869 --- /dev/null +++ b/SASPClean.ps1 @@ -0,0 +1,198 @@ +Add-Type -AssemblyName System.Windows.Forms +Add-Type -AssemblyName System.Drawing + +$scriptPath = $MyInvocation.MyCommand.Path +$scriptDirectory = Split-Path $scriptPath -Parent + +$packageJsonPath = Join-Path $scriptDirectory "package.json" +$packageJsonExists = Test-Path $packageJsonPath + +$iconFileName = "icon\SASPClean.png" +$iconPath = Join-Path $scriptDirectory $iconFileName + +$loadingForm = New-Object System.Windows.Forms.Form +$loadingForm.Text = "SASPClean Loading Screen" +$loadingForm.Size = New-Object System.Drawing.Size(400, 150) +$loadingForm.StartPosition = "CenterScreen" +$loadingForm.BackColor = [System.Drawing.Color]::FromArgb(255, 245, 245, 245) + +$loadingLabelPackageJson = New-Object System.Windows.Forms.Label +$loadingLabelPackageJson.Text = "Checking for updates..." +$loadingLabelPackageJson.Font = New-Object System.Drawing.Font("Arial", 12, [System.Drawing.FontStyle]::Bold) +$loadingLabelPackageJson.AutoSize = $true +$loadingLabelPackageJson.Location = New-Object System.Drawing.Point(20, 45) +$loadingForm.Controls.Add($loadingLabelPackageJson) + +$loadingForm.add_Shown({ + $iconFolder = Join-Path $scriptDirectory "icon" + if (-not (Test-Path $iconFolder -PathType Container)) { + [System.Windows.Forms.MessageBox]::Show("Error: 'icon' folder not found.", "Folder Not Found", "OK", "Error") + } + + $iconPath = Join-Path $scriptDirectory "icon\SASPClean.png" + if (-not (Test-Path $iconPath -PathType Leaf)) { + [System.Windows.Forms.MessageBox]::Show("Error: 'icon\SASPClean.png' not found.", "File Not Found", "OK", "Error") + } + + $packageJsonPath = Join-Path $scriptDirectory "package.json" + $packageJsonExists = Test-Path $packageJsonPath + if (-not $packageJsonExists) { + [System.Windows.Forms.MessageBox]::Show("Error: 'package.json' not found.", "File Not Found", "OK", "Error") + } + + $latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/sasprosko590/SASPClean/releases/latest" + if ($packageJsonExists) { + $packageJson = Get-Content -Path $packageJsonPath | ConvertFrom-Json + $currentVersion = $packageJson.version + + if ($latestRelease.tag_name -ne $currentVersion) { + $updateMessage = "A new version is available! Do you want to view the release?" + $userChoice = [System.Windows.Forms.MessageBox]::Show($updateMessage, "Update Available", "YesNo", "Information") + + if ($userChoice -eq "Yes") { + Start-Process $latestRelease.html_url + } + } + } + $loadingForm.Close() +}) + +$form = New-Object System.Windows.Forms.Form +$form.Text = "SASPClean" +$scriptPath = $MyInvocation.MyCommand.Path +$scriptDirectory = Split-Path $scriptPath -Parent +$image = [System.Drawing.Image]::FromFile($iconPath) +$icon = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap($image)).GetHicon()) +$form.Icon = $icon +$form.Size = New-Object System.Drawing.Size(1225, 600) +$form.StartPosition = "CenterScreen" +$form.AutoScroll = $true + +$backgroundColor = [System.Drawing.Color]::FromArgb(255, 245, 245, 245) +$buttonColor = [System.Drawing.Color]::FromArgb(255, 0, 102, 204) +$buttonForeColor = [System.Drawing.Color]::White +$form.BackColor = $backgroundColor + +$checkboxes = @{} +$checkboxOptions = @( + "Clear Windows Update - This command is designed to remove unnecessary files and optimize the Windows component store, helping to free up storage space on your system.", + "Check Disk - Basic (chkdsk /f) - This command examines the disk for errors and automatically addresses and repairs any issues it discovers.", + "Check Disk - Repair (chkdsk /r) - This command thoroughly checks the disk for errors, actively fixes identified issues, and recovers readable information to maintain disk health.", + "Check Disk External Drive Dismounted (chkdsk /x) - This command dismounts external drives and performs a disk check, identifying and addressing errors to ensure the health of the external storage.", + "DISM Add Packages - Adds Windows packages from a specified path to enhance system functionality.", + "DISM Check Health - Evaluates the health of the Windows image, ensuring the stability of system components.", + "DISM Get Packages - Lists all installed packages on the Windows image, providing an overview of system components.", + "DISM Repair - Repairs the Windows image using a specified source, fixing potential issues in the system.", + "DISM Repair 2 - Repairs the Windows image using an alternative specified source, ensuring system stability.", + "DISM Restore Health - Restores the health of the Windows image, addressing any detected inconsistencies.", + "Disk Cleaner - Opens the built-in Disk Cleanup utility, allowing removal of unnecessary files to free up disk space.", + "Disk Cleaner Sagerun - Executes the Disk Cleanup utility with predefined cleanup options, streamlining the removal of temporary files.", + "MDT (Windows Memory Diagnostic Tool) - Opens the Windows Memory Diagnostic Tool, allowing you to assess and diagnose potential issues related to your system's memory (RAM).", + "MRT (Windows Malicious Software Removal Tool) - Opens the Windows Malicious Software Removal Tool, scanning and removing specific types of malware to enhance system security.", + "File System Integrity Check - This command runs the System File Checker, ensuring the integrity of system files by scanning and repairing any detected problems.", + "Windows Experience Index Formal Assessment - Initiates a detailed evaluation of your system's performance through the Windows Experience Index. It provides valuable insights into the capabilities of both your hardware and software.", + "Upgrade winget - Utilizes the Windows Package Manager (Winget) to upgrade all installed applications, ensuring you have the latest versions with improved features and security updates.", + "Check Win Update - Looks for the latest Windows updates right away, ensuring your system is current with essential patches and improvements.", + "See if you have been hacked - Verifies possible security breaches on your system.", + "Initiate file cleanup - Deletes specific files, including those in the Prefetch, Temp, and %temp% directories, freeing up disk space and removing temporary files that are no longer needed." +) + +$yPosition = 20 +foreach ($option in $checkboxOptions) { + $checkbox = New-Object System.Windows.Forms.CheckBox + $checkbox.Text = $option + $checkbox.Location = New-Object System.Drawing.Point(20, $yPosition) + $checkbox.AutoSize = $true + $checkbox.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat + $checkbox.ForeColor = [System.Drawing.Color]::FromArgb(255, 33, 33, 33) + $form.Controls.Add($checkbox) + $checkboxes[$option] = $checkbox + $yPosition += 25 +} + +$runButton = New-Object System.Windows.Forms.Button +$runButton.Text = "Run" +$runButton.Location = New-Object System.Drawing.Point(20, $yPosition) +$runButton.BackColor = $buttonColor +$runButton.ForeColor = $buttonForeColor +$runButton.Width = 100 +$runButton.Add_Click({ + foreach ($option in $checkboxOptions) { + if ($checkboxes[$option].Checked) { + Write-Host "Running $option" + switch -wildcard ($option) { + "Check Disk - Basic*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "chkdsk /f" -Wait + } + "Check Disk External Drive Dismounted*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "chkdsk /x" -Wait + } + "Check Disk - Repair*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "chkdsk /r" -Wait + } + "Check Win Update*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "wuauclt.exe /detectnow" -Wait + } + "Clear Windows Update*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /cleanup-image /startcomponentcleanup" -Wait + } + "Disk Cleaner*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "cleanmgr.exe" -Wait + } + "Disk Cleaner Sagerun*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "cleanmgr /sagerun:1" -Wait + } + "DISM Add Packages*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /add-package /packagepath:C:\path\to\update.cab" -Wait + } + "DISM Check Health*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /cleanup-image /checkhealth" -Wait + } + "DISM Get Packages*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/k", "dism /online /get-packages" -Wait + } + "DISM Repair*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /cleanup-image /restorehealth /source:C:\path\to\source /limitaccess" -Wait + } + "DISM Repair 2*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /cleanup-image /restorehealth /source:C:\path\to\repairsource\install.wim" -Wait + } + "DISM Restore Health*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "dism /online /cleanup-image /restorehealth" -Wait + } + "MDT (Windows Memory Diagnostic Tool)*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "mdsched.exe" -Wait + } + "MRT (Windows Malicious Software Removal Tool)*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/k", "mrt.exe" -Wait + } + "File System Integrity Check*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "sfc /scannow" -Wait + } + "See if you have been hacked*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/k", "quser" -Wait + } + "Upgrade winget*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/k", "winget upgrade --all" -Wait + } + "Windows Experience Index Formal Assessment*" { + Start-Process 'cmd.exe' -Verb RunAs -ArgumentList "/c", "winsat formal" -Wait + } + "Initiate file cleanup*" { + Start-Process 'cmd.exe' -ArgumentList "/c", "npm install" -Wait + Start-Process 'cmd.exe' -ArgumentList "/k node test\index.test.js & pause" + } + } + } + } + }) +$form.Controls.Add($runButton) + +$Form.add_closing{ + if (-not $RanScript -and [Windows.Forms.MessageBox]::Show('Are you sure you want to exit?', 'Exit', 'YesNo', 'Question') -eq 'No') { + $_.Cancel = $true + } +} + +$loadingForm.ShowDialog() +$form.ShowDialog() \ No newline at end of file diff --git a/SECURITY.MD b/SECURITY.MD index acc0a8f..20c884a 100644 --- a/SECURITY.MD +++ b/SECURITY.MD @@ -6,7 +6,7 @@ Our project currently supports the following version: | Version | Supported | | ------- | ------------------- | -| 1.0.0 | :white_check_mark: | +| 1.0.1 | :white_check_mark: | ## Reporting a Vulnerability diff --git a/package.json b/package.json index d556959..d3b8a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saspclean", - "version": "1.0.0", + "version": "1.0.1", "description": "This script was created to restore the computer to the fast, pure and regular performance as it was when it was first purchased.", "main": "index.js", "scripts": { diff --git a/start.bat b/start.bat index 48f43d6..d60472c 100644 --- a/start.bat +++ b/start.bat @@ -1,378 +1,7 @@ @echo off - -REM Prompt user to select a language -:ask_language -set /p "language=Select a language (tr/en/de): " -if /i "%language%"=="en" ( - goto :english -) else if /i "%language%"=="tr" ( - goto :turkish -) else if /i "%language%"=="de" ( - goto :german -) else ( - echo Invalid input. Please enter 'en' for English, 'tr' for Turkish or 'de' for German. - goto :ask_language -) - -:turkish -REM Sorulari ve komutlari tanimla -set "soru[1]=Windows Guncellemelerini Temizle - Bu komut, Windows uzerindeki gereksiz dosyalari ve bilesen deposunu temizler." -set "komut[1]=dism /online /cleanup-image /startcomponentcleanup" - -set "soru[2]=Disk Kontrolu - Temel (chkdsk /f) - Bu komut, diskteki hatalari kontrol eder ve duzeltir." -set "komut[2]=chkdsk /f" - -set "soru[3]=Disk Kontrolu - Onar (chkdsk /r) - Bu komut, diskteki hatalari kontrol eder, duzeltir ve okunabilir bilgileri kurtarir." -set "komut[3]=chkdsk /r" - -set "soru[4]=Disk Kontrolu - Harici Surucu Ayirmali (chkdsk /x) - Bu komut, harici suruculeri ayirir ve diski kontrol eder." -set "komut[4]=chkdsk /x" - -set "soru[5]=DISM Paketleri Ekle - Bu komut, belirtilen yoldan Windows paketlerini ekler." -set "komut[5]=dism /online /add-package /packagepath:C:\path\to\update.cab" - -set "soru[6]=DISM Saglik Kontrolu - Bu komut, Windows gorselini kontrol eder." -set "komut[6]=dism /online /cleanup-image /checkhealth" - -set "soru[7]=DISM Paketleri Listele - Bu komut, Windows gorseline yuklenmis tum paketleri listeler." -set "komut[7]=dism /online /get-packages" - -set "soru[8]=DISM Onar - Bu komut, belirtilen kaynaktan Windows gorselini onarir." -set "komut[8]=dism /online /cleanup-image /restorehealth /source:C:\path\to\source /limitaccess" - -set "soru[9]=DISM Onar 2 - Bu komut, baska bir belirtilen kaynaktan Windows gorselini onarir." -set "komut[9]=dism /online /cleanup-image /restorehealth /source:C:\path\to\repairsource\install.wim" - -set "soru[10]=DISM Saglik Geri Yukle - Bu komut, Windows gorselinin sagligini geri yukler." -set "komut[10]=dism /online /cleanup-image /restorehealth" - -set "soru[11]=Disk Temizleyici - Bu komut, yerlesik Disk Temizleyici aracini acar." -set "komut[11]=cleanmgr.exe" - -set "soru[12]=Disk Temizleyici Sagerun - Bu komut, onceden belirlenmis temizleme secenekleriyle Disk Temizleyici aracini calistirir." -set "komut[12]=cleanmgr /sagerun:1" - -set "soru[13]=MDT (Windows Bellek Tani Araci) - Bu komut, Windows Bellek Tani Aracini acar." -set "komut[13]=mdsched.exe" - -set "soru[14]=MRT (Windows Zararli Yazilim Kaldirma Araci) - Bu komut, Windows Zararli Yazilim Kaldirma Aracini acar." -set "komut[14]=mrt.exe" - -set "soru[15]=Tarama - Bu komut, Sistem Dosyasi Denetleyicisi'ni calistirir (sfc /scannow)." -set "komut[15]=sfc /scannow" - -set "soru[16]=Windows Deneyim Endeksi Formel Degerlendirme - Bu komut, Windows Deneyim Endeksi formel degerlendirmesini calistirir." -set "komut[16]=winsat formal" - -set "soru[17]=Winget Guncelleme - Bu komut, Windows Paket Yoneticisi (Winget) kullanarak yuklu tum uygulamalari gunceller." -set "komut[17]=winget upgrade --all" - -set "soru[18]=Windows Guncelleme Kontrolu - Bu komut, Windows guncellemelerini kontrol eder." -set "komut[18]=wuauclt.exe /detectnow" - -set "soru[19]=Hacklenip hacklenmedigini gorme - Bu komut, hacklenip hacklenmedigini gosterir. (calismassa cmd yi acip 'quser' yazin.)" -set "komut[19]=quser" - -:sor_nodejs -REM Kullanicilara Node.js kurulu olup olmadigina dair bir soru sor -set /p "nodejs=Node.js kurulu mu? (e/h): " -if /i "%nodejs%"=="e" ( - goto :sor_init -) else if /i "%nodejs%"=="h" ( - echo https://nodejs.org/en - goto :sor_init -) else ( - echo Gecersiz giris. Lutfen 'e' veya 'h' girin. - goto :sor_nodejs -) - -:sor_init -REM Kullanicilara 'npm init -y' ile ilgili bir soru sor -set /p "init='npm init -y' baslatilsin mi? (ilk kez npm yukleniyorsa 'e' girin.) (e/h): " -if /i "%init%"=="e" ( - REM npm init komutunu calistir - call npm init -y -) else if /i "%init%"=="h" ( - echo NPM paketi baslatilamadi. -) else ( - echo Gecersiz giris. Lutfen 'e' veya 'h' girin. - goto :sor_init -) - -:sor_kurulum -REM Kullanicilara 'npm install' ile ilgili bir soru sor -call npm install - -:ek_komutlari_calistir -REM Ek sorulari ve komutlari calistir setlocal enabledelayedexpansion -set "soruIndeksi=1" - -:ek_komut_dongusu -if !soruIndeksi! leq 19 ( - set /p "komut_calistir=!soru[%soruIndeksi%]! Bu komutu calistirmak ister misiniz? (e/h): " - if /i "!komut_calistir!"=="e" ( - call :komutu_calistir %soruIndeksi% - ) else if /i "!komut_calistir!"=="h" ( - echo Komut gecildi: %soruIndeksi%. - ) else ( - echo Gecersiz giris. Lutfen 'e' veya 'h' girin. - ) - set /a "soruIndeksi+=1" - goto :ek_komut_dongusu -) - -endlocal - -call node test\index.test.js - -pause - -exit /b - -:komutu_calistir -REM Belirtilen komutu calistir -call powershell -Command "& { Start-Process cmd.exe -Verb RunAs -ArgumentList '/c', '!komut[%1]!' -Wait }" -exit /b - -:english -REM Defining questions and commands -set "question[1]=Clear Windows Update - This command is used to clean up junk files and the component store on Windows." -set "command[1]=dism /online /cleanup-image /startcomponentcleanup" - -set "question[2]=Check Disk - Basic (chkdsk /f) - This command checks for errors on the disk and fixes them." -set "command[2]=chkdsk /f" - -set "question[3]=Check Disk - Repair (chkdsk /r) - This command checks for errors on the disk, fixes them, and recovers readable information." -set "command[3]=chkdsk /r" - -set "question[4]=Check Disk - External Drive Dismounted (chkdsk /x) - This command dismounts external drives and checks the disk for errors." -set "command[4]=chkdsk /x" - -set "question[5]=DISM Add Packages - This command adds Windows packages from a specified path." -set "command[5]=dism /online /add-package /packagepath:C:\path\to\update.cab" - -set "question[6]=DISM Check Health - This command checks the health of the Windows image." -set "command[6]=dism /online /cleanup-image /checkhealth" - -set "question[7]=DISM Get Packages - This command lists all installed packages on the Windows image." -set "command[7]=dism /online /get-packages" - -set "question[8]=DISM Repair - This command repairs the Windows image using a specified source." -set "command[8]=dism /online /cleanup-image /restorehealth /source:C:\path\to\source /limitaccess" - -set "question[9]=DISM Repair 2 - This command repairs the Windows image using another specified source." -set "command[9]=dism /online /cleanup-image /restorehealth /source:C:\path\to\repairsource\install.wim" - -set "question[10]=DISM Restore Health - This command restores the health of the Windows image." -set "command[10]=dism /online /cleanup-image /restorehealth" - -set "question[11]=Disk Cleaner - This command opens the built-in Disk Cleanup utility." -set "command[11]=cleanmgr.exe" - -set "question[12]=Disk Cleaner Sagerun - This command runs the Disk Cleanup utility with a predefined set of cleanup options." -set "command[12]=cleanmgr /sagerun:1" - -set "question[13]=MDT (Windows Memory Diagnostic Tool) - This command opens the Windows Memory Diagnostic Tool." -set "command[13]=mdsched.exe" - -set "question[14]=MRT (Windows Malicious Software Removal Tool) - This command opens the Windows Malicious Software Removal Tool." -set "command[14]=mrt.exe" - -set "question[15]=Scan - This command runs the System File Checker (sfc /scannow)." -set "command[15]=sfc /scannow" - -set "question[16]=Windows Experience Index Formal Assessment - This command runs the Windows Experience Index formal assessment." -set "command[16]=winsat formal" - -set "question[17]=Upgrade winget - This command upgrades all installed apps using Windows Package Manager (Winget)." -set "command[17]=winget upgrade --all" - -set "question[18]=Check Win Update - This command checks for Windows updates immediately." -set "command[18]=wuauclt.exe /detectnow" - -set "question[19]=See if you have been hacked - This command shows if you have been hacked. (if it doesn't work, open cmd and type 'quser')." -set "command[19]=quser" - -:ask_nodejs -REM Ask a question to the user about Node.js installation -set /p "nodejs=Have you installed Node.js? (y/n): " -if /i "%nodejs%"=="y" ( - goto :ask_init -) else if /i "%nodejs%"=="n" ( - echo https://nodejs.org/en - goto :ask_init -) else ( - echo Invalid input. Please enter 'y' or 'n'. - goto :ask_nodejs -) - -:ask_init -REM Ask a question to the user about 'npm init -y' -set /p "init=Initialize 'npm init -y' (type 'y' if you are installing npm for the first time) (y/n): " -if /i "%init%"=="y" ( - REM Run the npm init command - call npm init -y -) else if /i "%init%"=="n" ( - echo NPM package was not initialized. -) else ( - echo Invalid input. Please enter 'y' or 'n'. - goto :ask_init -) - -:ask_install -REM install 'npm install' -call npm install - -:run_additional_commands -REM Run additional questions and commands -setlocal enabledelayedexpansion -set "questionIndex=1" - -:run_additional_cmd_loop -if !questionIndex! leq 19 ( - set /p "run_command=!question[%questionIndex%]! Do you want to run this command? (y/n): " - if /i "!run_command!"=="y" ( - call :run_command %questionIndex% - ) else if /i "!run_command!"=="n" ( - echo Skipped command %questionIndex%. - ) else ( - echo Invalid input. Please enter 'y' or 'n'. - ) - set /a "questionIndex+=1" - goto :run_additional_cmd_loop -) - -endlocal - -call node test\index.test.js - -pause - -exit /b - -:run_command -REM Run the specified command -call powershell -Command "& { Start-Process cmd.exe -Verb RunAs -ArgumentList '/c', '!command[%1]!' -Wait }" -exit /b - -:german -REM Definition von Fragen und Befehlen -set "question[1]=Windows Update löschen - Dieser Befehl wird verwendet, um Junk-Dateien und den Komponentenspeicher unter Windows zu bereinigen." -set "command[1]=dism /online /cleanup-image /startcomponentcleanup" - -set "question[2]=Festplattenprüfung - Grundlegende (chkdsk /f) - Dieser Befehl überprüft Fehler auf der Festplatte und behebt sie." -set "command[2]=chkdsk /f" - -set "question[3]=Festplattenprüfung - Reparatur (chkdsk /r) - Dieser Befehl überprüft Fehler auf der Festplatte, behebt sie und stellt lesbare Informationen wieder her." -set "command[3]=chkdsk /r" - -set "question[4]=Festplattenprüfung - Externe Laufwerke aushängen (chkdsk /x) - Dieser Befehl hängt externe Laufwerke aus und überprüft die Festplatte auf Fehler." -set "command[4]=chkdsk /x" - -set "question[5]=DISM Pakete hinzufügen - Dieser Befehl fügt Windows-Pakete von einem bestimmten Pfad hinzu." -set "command[5]=dism /online /add-package /packagepath:C:\path\to\update.cab" - -set "question[6]=DISM Überprüfen der Integrität - Dieser Befehl überprüft die Integrität des Windows-Abbilds." -set "command[6]=dism /online /cleanup-image /checkhealth" - -set "question[7]=DISM Pakete abrufen - Dieser Befehl listet alle installierten Pakete im Windows-Abbild auf." -set "command[7]=dism /online /get-packages" - -set "question[8]=DISM Reparatur - Dieser Befehl repariert das Windows-Abbild unter Verwendung einer angegebenen Quelle." -set "command[8]=dism /online /cleanup-image /restorehealth /source:C:\path\to\source /limitaccess" - -set "question[9]=DISM Reparatur 2 - Dieser Befehl repariert das Windows-Abbild unter Verwendung einer anderen angegebenen Quelle." -set "command[9]=dism /online /cleanup-image /restorehealth /source:C:\path\to\repairsource\install.wim" - -set "question[10]=DISM Integrität wiederherstellen - Dieser Befehl stellt die Integrität des Windows-Abbilds wieder her." -set "command[10]=dism /online /cleanup-image /restorehealth" - -set "question[11]=Datenträgerbereinigung - Dieser Befehl öffnet das integrierte Datenträgerbereinigungsprogramm." -set "command[11]=cleanmgr.exe" - -set "question[12]=Datenträgerbereinigung Sagerun - Dieser Befehl führt das Datenträgerbereinigungsprogramm mit einem vordefinierten Satz von Bereinigungsoptionen aus." -set "command[12]=cleanmgr /sagerun:1" - -set "question[13]=MDT (Windows Memory Diagnostic Tool) - Dieser Befehl öffnet das Windows Memory Diagnostic Tool." -set "command[13]=mdsched.exe" - -set "question[14]=MRT (Windows Malicious Software Removal Tool) - Dieser Befehl öffnet das Windows Malicious Software Removal Tool." -set "command[14]=mrt.exe" - -set "question[15]=Überprüfen - Dieser Befehl führt den System File Checker aus (sfc /scannow)." -set "command[15]=sfc /scannow" - -set "question[16]=Formale Bewertung des Windows Experience Index - Dieser Befehl führt die formale Bewertung des Windows Experience Index aus." -set "command[16]=winsat formal" - -set "question[17]=Winget aktualisieren - Dieser Befehl aktualisiert alle installierten Apps mit dem Windows Package Manager (Winget)." -set "command[17]=winget upgrade --all" - -set "question[18]=Windows Update überprüfen - Dieser Befehl überprüft sofort auf Windows-Updates." -set "command[18]=wuauclt.exe /detectnow" - -set "question[19]=Prüfen, ob Sie gehackt wurden - Dieser Befehl zeigt an, ob Sie gehackt wurden. (wenn das nicht funktioniert, öffnen Sie cmd und geben Sie 'quser' ein)." -set "command[19]=quser" - -:ask_nodejs -REM Eine Frage an den Benutzer zur Installation von Node.js stellen -set /p "nodejs=Haben Sie Node.js installiert? (j/n): " -if /i "%nodejs%"=="j" ( - goto :ask_init -) else if /i "%nodejs%"=="n" ( - echo https://nodejs.org/en - goto :ask_init -) else ( - echo Ungültige Eingabe. Bitte geben Sie 'j' oder 'n' ein. - goto :ask_nodejs -) - -:ask_init -REM Eine Frage an den Benutzer zu 'npm init -y' stellen -set /p "init=Initialisieren von 'npm init -y' (geben Sie 'j' ein, wenn Sie npm zum ersten Mal installieren) (j/n): " -if /i "%init%"=="j" ( - REM Führen Sie den npm init-Befehl aus - call npm init -y -) else if /i "%init%"=="n" ( - echo Das NPM-Paket wurde nicht initialisiert. -) else ( - echo Ungültige Eingabe. Bitte geben Sie 'j' oder 'n' ein. - goto :ask_init -) - -:ask_install -REM 'npm install' installieren -call npm install - -:run_additional_commands -REM Zusätzliche Fragen und Befehle ausführen -setlocal enabledelayedexpansion -set "questionIndex=1" - -:run_additional_cmd_loop -if !questionIndex! leq 19 ( - set /p "run_command=!question[%questionIndex%]! Möchten Sie diesen Befehl ausführen? (j/n): " - if /i "!run_command!"=="j" ( - call :run_command %questionIndex% - ) else if /i "!run_command!"=="n" ( - echo Befehl %questionIndex% übersprungen. - ) else ( - echo Ungültige Eingabe. Bitte geben Sie 'j' oder 'n' ein. - ) - set /a "questionIndex+=1" - goto :run_additional_cmd_loop -) - -endlocal - -call node test\index.test.js - -pause - -exit /b - -:run_command -REM Den angegebenen Befehl ausführen -call powershell -Command "& { Start-Process cmd.exe -Verb RunAs -ArgumentList '/c', '!command[%1]!' -Wait }" -exit /b +set "scriptName=SASPClean.ps1" +set "currentDir=%~dp0" +set "scriptPath=!currentDir!!scriptName!" +powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "!scriptPath!" +endlocal \ No newline at end of file