Modified .bat file to automatically open the Powershell script as admin.
This commit is contained in:
parent
c56835cf8c
commit
e6ddc0797d
Notes:
Tanner Van Teeffelen
2026-05-11 12:40:59 -04:00
Also fixed a minor grammatical mistake and added in a color for an error.
2 changed files with 3 additions and 9 deletions
|
|
@ -2,11 +2,5 @@
|
|||
rem Developed by Tanner Van Teeffelen
|
||||
rem Copyright ACO Services Inc. 2026
|
||||
|
||||
rem Sets path equal to the location of the running script.
|
||||
SET drivepath=%~dp0
|
||||
|
||||
rem Removes extra slash at the end of the drive path.
|
||||
%drivepath:~0,-1%
|
||||
|
||||
rem Runs installer with the ExecutionPolicy set to bypass.
|
||||
powershell.exe -executionpolicy bypass -file %drivepath%\RDPSign.ps1
|
||||
powershell.exe -Command "Start-Process PowerShell -ArgumentList '-ExecutionPolicy Bypass -File ""%~dp0RDPSign.ps1""' -Verb RunAs"
|
||||
|
|
@ -31,7 +31,7 @@ Write-Host "-------------------------------------------`n" -ForegroundColor Blue
|
|||
$rdpFile
|
||||
$certSubjectName
|
||||
|
||||
Write-Host "Before proceeding, please ensure that the .RDP file you select has the permissions you want" -ForegroundColor Green
|
||||
Write-Host "Before proceeding, please ensure that the .RDP file you select has the permissions you want." -ForegroundColor Green
|
||||
Write-Host "This includes redirected printers, drives, and clipboard." -Foreground Green
|
||||
Write-Host "If you make a change to the .RDP file, please run this program again after making your changes.`n" -ForegroundColor Red
|
||||
Write-Host "Press any key to continue.`n" -ForegroundColor Green
|
||||
|
|
@ -130,7 +130,7 @@ if (Test-Path $rdpFile) {
|
|||
rdpsign.exe /sha256 $thumbprint "$rdpFile"
|
||||
Write-Host "Success! RDP file is ready for use" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Error "Target RDP file not found at $rdpFile"
|
||||
Write-Error "Target RDP file not found at $rdpFile" -ForegroundColor Red
|
||||
}
|
||||
|
||||
Write-Host "Press any key to exit." -ForegroundColor Green
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue