From 32fd5b4002cf67efc9e10cfdb50c71d4773b6fa9 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 23 Jul 2024 07:43:46 +0530 Subject: [PATCH] Set ComSpec variable --- get | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 }