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-12 12:28
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Repost: Assign the DOS version information string to a variable View 2,096 Replies 1
Original Poster Posted 2003-04-09 00:00 ·  中国 广东 佛山 禅城区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
Quoted from a reply post on the NetEase community. I haven't tried it myself.

How to assign the version information string obtained by var to a variable

You can extract the variable from prompt; below is a general method:

You can create a batch file in the following form; the contents can be modified as needed.
::getvar.bat
@if == prompt set %2=%3
@if == goto end
@echo off
%comspec% /c %0 invoke %1 %2>tt.bat
call tt

:end

When running it, just add the environment variable name and the corresponding prompt variable value, for example:
getvar curver $v

The advantage of this method is that besides getting the DOS version, it can also get other variables provided by prompt. In addition, its temporary file can be created and deleted at runtime, thus allowing it to run as a standalone program.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 2 Posted 2003-04-10 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
I think using STRINGS VER is still more convenient.
Wengier - 新DOS时代

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

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

Forum Jump: