mirror of
https://github.com/massgravel/get.activated.win.git
synced 2024-12-28 21:18:57 +01:00
Set ComSpec variable
This commit is contained in:
parent
0b7cc3d8a0
commit
32fd5b4002
1 changed files with 3 additions and 1 deletions
4
get
4
get
|
@ -27,7 +27,9 @@ $prefix = "@::: $rand `r`n"
|
||||||
$content = $prefix + $response
|
$content = $prefix + $response
|
||||||
Set-Content -Path $FilePath -Value $content
|
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")
|
$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd")
|
||||||
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }
|
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }
|
||||||
|
|
Loading…
Reference in a new issue