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 07:47
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How do I use 2004/03/01 from date as a filename after removing the / ? View 998 Replies 7
Original Poster Posted 2004-03-01 00:00 ·  中国 北京 联通
初级用户
Credits 111
Posts 4
Joined 2004-03-01 00:00
22-year member
UID 18872
Gender Female
Status Offline
Thanks
Floor 2 Posted 2004-03-01 00:00 ·  中国 江西 吉安 永新县 电信
初级用户
Credits 182
Posts 27
Joined 2003-11-12 00:00
22-year member
UID 12731
Gender Male
Status Offline
a$=Left$ (Date$, 2) + Mid$ (Date$, 4, 2) + Right$ (Date$, 4)
+".txt"
a$ is what you want
Floor 3 Posted 2004-03-01 00:00 ·  中国 北京 联通
初级用户
Credits 111
Posts 4
Joined 2004-03-01 00:00
22-year member
UID 18872
Gender Female
Status Offline
Sorry, but how do I reference a$? I don't think it's a variable. Asking for advice, many thanks
Floor 4 Posted 2004-03-01 00:00 ·  中国 广东 佛山 三水区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
This is a QUICK BASIC 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 5 Posted 2004-03-01 00:00 ·  中国 北京 联通
初级用户
Credits 111
Posts 4
Joined 2004-03-01 00:00
22-year member
UID 18872
Gender Female
Status Offline
Ah, my friend, you got my hopes up for nothing. What I meant was, I'm using DOS commands in a batch file and I need a filename based on the date. What %date% gives me is "Monday 2004/03/01", but I can't use that as a filename, so I have to do some string processing. I don't know whether strings can be processed in a batch file, or how to do it. I also couldn't find anything about this online.
Floor 6 Posted 2004-03-01 00:00 ·  中国 北京 联通
初级用户
Credits 111
Posts 4
Joined 2004-03-01 00:00
22-year member
UID 18872
Gender Female
Status Offline
Sorry, I left out too much when describing the problem. My apologies, and thanks anyway
Floor 7 Posted 2004-03-03 00:00 ·  中国 北京 顺义区 联通
初级用户
Credits 113
Posts 4
Joined 2004-03-02 00:00
22-year member
UID 18952
Gender Male
Status Offline
I need the answer to this question too
Floor 8 Posted 2004-03-04 00:00 ·  中国 北京 顺义区 联通
初级用户
Credits 113
Posts 4
Joined 2004-03-02 00:00
22-year member
UID 18952
Gender Male
Status Offline
I just learned a way:
First use SET to extract the month, day, and year, then combine them. Give it a try; if it doesn't work, check the help : )
Forum Jump: