- 帖子
- 185
- 积分
- 260
- 技术
- 14
- 捐助
- 0
- 注册时间
- 2022-4-23
|
本帖最后由 LJY4.0 于 2022-6-12 07:47 编辑
进程通讯(文件法):
窗口1:
@echo off
del %temp%\ttt.tc
del %temp%\ccc.tc
for %%a in (
echo XXX
echo XXX
)>%temp%\ttt.tc
:ec
if not exist %temp%\ccc.tc goto ec
type %temp%\ccc.tc
pause>nul
exit
窗口2:
@echo off
:win
if not exist %temp%\ttt.tc goto win
for /f "delims=" %%a in ('type %temp%\ttt.tc') do (
set str=%%a
(处理代码(发送内容:变量str))>%temp%\ccc.tc
)
注意 (处理代码(发送内容:变量str))>%temp%\ccc.tc最外的括号别删
参数法:
1:
@echo off
if "%~1"=="" goto start
echo %~1
pause>nul
exit
:start
start 窗口2路径 发送内容
exit
2:
@echo off
if "%~1"=="" exit
set str=%~1
for /f "delmis=" %%a in ('^(处理代码(发送内容:变量str)^)') do (
start 窗口1路径 %%a
)
exit
注意:for /f "delmis=" %%a in (^(处理代码(发送内容:变量str)^)) do ( 只可删(发送内容:变量str)这段注释
一行用参数法
多行用文件法
如果你把处理代码发过来的话,我明天帮你整理好(最好发过来) |
|