diff options
| author | WindowsAddict | 2024-11-01 13:43:57 +0000 |
|---|---|---|
| committer | WindowsAddict | 2024-11-01 13:43:57 +0000 |
| commit | 6fb7183c769d1f7a6c0b6e9da2903a47b5d5daa8 (patch) | |
| tree | cd981235a960117daa58f9695c93906820f94264 /static/get.ps1 | |
| parent | 673f3212a8ca079f5c3e74b3e8969eba1870d214 (diff) | |
| download | massgrave.dev-6fb7183c769d1f7a6c0b6e9da2903a47b5d5daa8.zip | |
Avoid Temp variable
Diffstat (limited to 'static/get.ps1')
| -rw-r--r-- | static/get.ps1 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/static/get.ps1 b/static/get.ps1 index 32e1d08..d620784 100644 --- a/static/get.ps1 +++ b/static/get.ps1 @@ -55,7 +55,7 @@ foreach ($path in $paths) { $rand = [Guid]::NewGuid().Guid
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
-$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }
+$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:USERPROFILE\AppData\Local\Temp\MAS_$rand.cmd" }
$ScriptArgs = "$args "
$prefix = "@::: $rand `r`n"
@@ -66,5 +66,5 @@ Set-Content -Path $FilePath -Value $content $env:ComSpec = "$env:SystemRoot\system32\cmd.exe"
Start-Process cmd.exe "/c """"$FilePath"" $ScriptArgs""" -Wait
-$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd")
+$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }
|
