中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 11:31
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » How do I use 2004/03/01 from date as a filename after removing the / ?
Printable Version  1,184 / 7
Floor1 dongruimin Posted 2004-03-01 00:00
初级用户 Posts 4 Credits 111
Thanks
Floor2 冷石_jasv Posted 2004-03-01 00:00
初级用户 Posts 27 Credits 182
a$=Left$ (Date$, 2) + Mid$ (Date$, 4, 2) + Right$ (Date$, 4)
+".txt"
a$ is what you want
Floor3 dongruimin Posted 2004-03-01 00:00
初级用户 Posts 4 Credits 111
Sorry, but how do I reference a$? I don't think it's a variable. Asking for advice, many thanks
Floor4 MYS Posted 2004-03-01 00:00
元老会员 Posts 1,637 Credits 5,170 From 广东佛山
This is a QUICK BASIC program
Floor5 dongruimin Posted 2004-03-01 00:00
初级用户 Posts 4 Credits 111
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.
Floor6 dongruimin Posted 2004-03-01 00:00
初级用户 Posts 4 Credits 111
Sorry, I left out too much when describing the problem. My apologies, and thanks anyway
Floor7 xzwe Posted 2004-03-03 00:00
初级用户 Posts 4 Credits 113
I need the answer to this question too
Floor8 xzwe Posted 2004-03-04 00:00
初级用户 Posts 4 Credits 113
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 : )
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023