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-01 00:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » (Resolved) How to determine whether the system is 95/98 or 2000/XP through batch processing View 2,122 Replies 3
Original Poster Posted 2005-09-14 16:59 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re xjhlhb:

"Please start a new thread for new questions", which is beneficial for management and browsing, and also allows more people to see the question and give their own answers.

There are many ways to determine the system type. The simplest is to use the variable %OS%, which has a value of Windows_NT under NT series, otherwise it is empty.

[ Last edited by willsort on 2005-9-16 at 09:53 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 2 Posted 2005-09-14 21:25 ·  中国 山东 济南 莱芜区 联通
高级用户
★★
Credits 736
Posts 210
Joined 2004-04-12 00:00
22-year member
UID 22336
Gender Male
From 中國
Status Offline
Thanks to the team for your instruction!!! What about in the WIN95/98 system? I wonder if there is a %OS% system variable????
Floor 3 Posted 2005-09-15 22:19 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Under Win9x, there is usually no %OS% system variable, while under WinNT series, its value is all Windows_NT, so it can be simply judged.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 4 Posted 2008-11-15 11:55 ·  中国 云南 昆明 电信
初级用户
★★
Credits 76
Posts 64
Joined 2008-04-24 23:56
18-year member
UID 116884
Gender Male
Status Offline
```
if NOT {%OS%} == {} goto winnt
:win98
::Code for win98
goto ENDOSDECTED
:winnt
::Code for winnt
:ENDOSDECTED
```
Forum Jump: