China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-05 07:56
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to pass environment variables to another BAT View 974 Replies 3
Original Poster Posted 2007-03-27 03:26 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
For example:
Contents of 11.bat:

echo off
set a =12
start "" "22.bat"


When 22.bat opens, how can %a% become 12? In other words, how can the environment variable from 11.bat be passed to 22.BAT

Requirement: 22.BAT must be opened in a new window, so the CALL command cannot be used
Floor 2 Posted 2007-03-27 04:26 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 3 Posted 2007-03-27 07:23 ·  中国 上海 东方有线
中级用户
★★
Credits 218
Posts 86
Joined 2006-08-10 10:45
19-year member
UID 60205
Gender Male
Status Offline
Floor 4 Posted 2007-06-30 09:30 ·  中国 浙江 嘉兴 海宁市 电信
中级用户
★★
Credits 360
Posts 216
Joined 2007-05-29 17:41
19-year member
UID 89677
Gender Male
Status Offline
Then, how can I use CALL to pass the variable from 11.bat into 22.bat?
Forum Jump: