From 901d975f6998d9f3ef8e3b4ca8afd4a9ec9b5b75 Mon Sep 17 00:00:00 2001 From: "Adam J. Kessel" Date: Tue, 13 Aug 2024 09:59:00 -0400 Subject: [PATCH] Fixed temporary directory location --- sit-stand.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sit-stand.ps1 b/sit-stand.ps1 index c60f79c..06e3cdf 100644 --- a/sit-stand.ps1 +++ b/sit-stand.ps1 @@ -36,6 +36,12 @@ Param( [Parameter(Mandatory = $false, HelpMessage = "Display this help message")][switch]$help, [Parameter(Mandatory = $false, HelpMessage = "Uninstall")][switch]$uninstall ) +if ( test-path $env:TEMP ) { + $null = Set-Location $env:TEMP +} +elseif ( test-path "c:\windows\temp" ) { + $null = Set-Location "c:\windows\temp" +} Add-Type -AssemblyName System.Drawing Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName PresentationFramework @@ -425,7 +431,11 @@ Function GetIcon { $Rectangle = [System.Drawing.RectangleF]::FromLTRB(0, 0, 128, 128) $graphics.DrawString($number, $Font, $bg, $rectangle, $format) $graphics.Dispose() - Return [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon())) + #$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon()))) + #$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon()))) + #$icon = $bmp.GetHIcon() + $icon = [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon())) + Return $icon } # experimental setting to check "focus assist" @@ -448,4 +458,4 @@ function DisturbOk { else { return $true } } -& $MainFunction \ No newline at end of file +& $MainFunction