@echo off set zipfile=LocalDeployment.zip set destination=%userprofile%\AppData\local\AutoscanTerminal set inf_file=%~dp0AutoScanTerminal.inf REM Check if .NET 6 Runtime is installed powershell -Command "& {if ((Test-Path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\') -and (Get-ChildItem -Path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\' -Directory | Where-Object { $_.Name -like '6.*' }) -eq $null) {Write-Host '.NET Runtime 6.0 is required.' -ForegroundColor Red; exit 1}}" REM Create destination folder if it doesn't exist if not exist "%destination%" ( mkdir "%destination%" ) REM Unzip the content of the zipfile to the destination folder powershell -Command "Expand-Archive -Path '%~dp0%zipfile%' -DestinationPath '%destination%' -Force" REM Create the shortcut on the desktop powershell -ExecutionPolicy Bypass -Command "& {$desktopPath = [Environment]::GetFolderPath('Desktop'); $ShortcutPath = [System.IO.Path]::Combine($desktopPath, 'MedipathSSH.lnk'); $WshShell = New-Object -ComObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut($ShortcutPath); $TargetPath = [System.IO.Path]::Combine('%destination%', 'AutoscanTerminal.exe'); $Shortcut.TargetPath = $TargetPath; $Shortcut.Arguments = '\"%inf_file%\"'; $Shortcut.WorkingDirectory = '%destination%'; $Shortcut.Save()}" echo Shortcut created on the desktop. REM Wait for 3 seconds timeout /t 3 /nobreak >nul REM Execute the shortcut powershell -Command "& {start-process ([System.IO.Path]::Combine([Environment]::GetFolderPath('Desktop'), 'MedipathSSH.lnk'))}" pause