标题: [文本处理] 如何将一段代码在批处理中执行,写到txt文本中 [打印本页]
作者: woonew 时间: 2024-7-12 16:41 标题: 如何将一段代码在批处理中执行,写到txt文本中
- if "%1"=="hide" goto CmdBegin
- start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit
- :CmdBegin
复制代码
请教,如何将上一段代码内容,在a.bat执行,写到b.txt里
作者: 77七 时间: 2024-7-12 17:19
- @echo off
- cd /d "%~dp0"
- >"b.txt" (
- echo if "%%1"=="hide" goto CmdBegin
- echo start mshta vbscript:createobject^("wscript.shell"^).run^("""%%~0"" hide",0^)^(window.close^)^&^&exit
- echo :CmdBegin
- )
- pause
复制代码
- @echo off
- cd /d "%~dp0"
- more +5 "%~f0" > "b.txt"
- pause
- exit
- if "%1"=="hide" goto CmdBegin
- start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit
- :CmdBegin
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |