From 8e75aeba7ed7a35c4be39504415eaa224f8ff815 Mon Sep 17 00:00:00 2001 From: cwrentmore <63152715+cwrentmore@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:46:28 -0400 Subject: [PATCH] Resolve Desktop path dynamically for current user Uses Windows Known Folder API so the script works on any workstation without modifying user paths. --- RDPSign.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RDPSign.ps1 b/RDPSign.ps1 index 6ee1c44..582b13f 100644 --- a/RDPSign.ps1 +++ b/RDPSign.ps1 @@ -9,7 +9,11 @@ # ============================================================================== # 1. Configuration -$rdpFile = "C:\Users\Desktop\RDPFILENAME.rdp" + +# Resolve the current signed in user's Desktop path +$desktopPath = [Environment]::GetFolderPath('Desktop') +$rdpFile = Join-Path $desktopPath 'Azure\asgc-data.rdp' + $certSubjectName = "CompanyNameIT-RDP" $certSubject = "CN=$certSubjectName" @@ -75,4 +79,4 @@ if (Test-Path $rdpFile) { Write-Host "Success! RDP file is ready for use." -ForegroundColor Green } else { Write-Error "Target RDP file not found at $rdpFile" -} \ No newline at end of file +}