summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWindowsAddict2024-07-23 02:13:46 +0000
committerWindowsAddict2024-07-23 02:13:46 +0000
commit32fd5b4002cf67efc9e10cfdb50c71d4773b6fa9 (patch)
treebfe3548748c5130433a394b3f9e6530c7a550d53
parent0b7cc3d8a015294175af2711de3c7be68a60d696 (diff)
downloadmassgravel.github.io-32fd5b4002cf67efc9e10cfdb50c71d4773b6fa9.zip
Set ComSpec variable
-rw-r--r--get4
1 files changed, 3 insertions, 1 deletions
diff --git a/get b/get
index 6143704..638530e 100644
--- a/get
+++ b/get
@@ -27,7 +27,9 @@ $prefix = "@::: $rand `r`n"
$content = $prefix + $response
Set-Content -Path $FilePath -Value $content
-Start-Process $FilePath $ScriptArgs -Wait
+# Set ComSpec variable for current session in case its corrupt in the system
+$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")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }