代码功能是在指定位置创建指定批处理
代码如下- echo $computer="%cname%" > "%USERPROFILE%\Desktop\test.bat"
- for /f "delims=:" %%i in ('findstr /n "^:1$" "%~f0"') do (
- more +%%i "%~f0" >> "%USERPROFILE%\Desktop\test.bat"
- )
- :1
- powershell -executionpolicy remotesigned -file "%USERPROFILE%\Desktop\test.ps1"
复制代码
|