- <#*,:&cls
- @echo off
- pushd "%~dp0"
- set "file=a.txt"
- Powershell -NoProfile -Command "$arrlines = Get-Content -ReadCount 0 -LiteralPath \"%file%\";$count = $arrlines.Count;[System.IO.File]::WriteAllLines(\"%file%\", @('N1 ;P888', 'N2 G27 G90', 'N3 G00 Z0', 'N4 (UAO,1)') + $arrlines[10..($count - 10)] + 'N7417 G00 M10' + $arrlines[-8] + @('N16256 G00 Z0', 'N16257 G00 X0', 'N16258 G00 Z0', 'N16259 G79X(@XPARK)', 'N16260 Y(@YPARK)', 'N16261 M30'))"
- popd
- pause
- exit /b
- #>
复制代码
|