Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dos question

0 views
Skip to first unread message

RL

unread,
Aug 21, 2008, 12:26:29 PM8/21/08
to
Hello,

I'm trying to work with a batch-file.
i want to make a dir that has the systemdate as its name.
Is this possible?
Wich command do i have to put after md?


Thanks for the help
RL

Geo

unread,
Aug 21, 2008, 3:00:59 PM8/21/08
to
On Thu, 21 Aug 2008 18:26:29 +0200, "RL" <Fa...@adress.nl> wrote:

>I'm trying to work with a batch-file.
>i want to make a dir that has the systemdate as its name.
>Is this possible?
>Wich command do i have to put after md?
>
>

In BASIC I think it would be MKDIR DATE$ - but no idea about DOS batch files.
I suggest you try a group with batch in the name - perhaps alt.msdos.batch?


Geo

RobertVA

unread,
Aug 21, 2008, 3:23:08 PM8/21/08
to

A few decades ago someone thought it they were being clever to name a
programming language Beginner's All-purpose Symbolic Instruction Code
because it supported the acronym "BASIC". Since newsgroup names reflect
the tree structure of the server's group hierarchy (similar to the
folder structure on a hard drive) and the convention of not using
capital letters in group names (concealing the status of "BASIC" as an
acronym) microsoft.public.basic.dos reflects the group's focus on BASIC
programming languages that runs in a dos environment.

Still someone here might know how to implement your goal. You may want
to post a similar inquiry in Microsoft groups focused towards DOS and or
Windows command prompts like ...win2000.cmdprompt.admin and
...win3x_wfw_dos (please mention that you were redirected there from
another news group).

You might even find a similar thread on the commonly mirrored
alt.msdos.batch. If your ISP doesn't mirror Usenet groups the batch
group is mirrored in Google groups at
http://groups.google.com/group/alt.msdos.batch/topics

RL

unread,
Aug 21, 2008, 5:00:08 PM8/21/08
to

"RobertVA" <robert_c7...@invalid.com> schreef in bericht
news:uG8aaN8A...@TK2MSFTNGP05.phx.gbl...

Thanks,
gr
RL

Bob Milutinovic

unread,
Sep 1, 2008, 11:39:02 PM9/1/08
to
"Geo" <hw9j...@dea.spamcon.org> wrote in message
news:plera4t2pqmhfrjko...@4ax.com...

Two problems with that suggestion;

1. No flavour of DOS-based BASIC I know of supports extended filenames; the
directory name would be truncated to the first eight characters.

2. The command processor will interpret the slashes ("/") supplied by DATE$
as either parameters (in the case of traditional DOS) or subdirectories (in
the case of an NT-style command processor); in either case the result'll be
undesirable.

My preferred method would be to create directories based on the universal
date format;

MKDIR RIGHT$(DATE$,4)+LEFT$(DATE$,2)+MID$(DATE$,4,2)

Of course, this has no bearing on the original poster's intent of using a
single command line; the thought of using the system environment variable
%date% would be the first step, but given this supplies (at least in the
case of the NT-style command processor) the date as "Tue 02/09/2008" for
today, it poses more problems than it solves.

- Bob.


Geo

unread,
Sep 2, 2008, 3:45:43 AM9/2/08
to
On Tue, 2 Sep 2008 13:39:02 +1000, "Bob Milutinovic" <cogn...@gmail.com> wrote:


>Two problems with that suggestion;
>
>1. No flavour of DOS-based BASIC I know of supports extended filenames; the
>directory name would be truncated to the first eight characters.
>
>2. The command processor will interpret the slashes ("/") supplied by DATE$
>as either parameters (in the case of traditional DOS) or subdirectories (in
>the case of an NT-style command processor); in either case the result'll be
>undesirable.
>
>My preferred method would be to create directories based on the universal
>date format;
>
>MKDIR RIGHT$(DATE$,4)+LEFT$(DATE$,2)+MID$(DATE$,4,2)
>
>Of course, this has no bearing on the original poster's intent of using a
>single command line; the thought of using the system environment variable
>%date% would be the first step, but given this supplies (at least in the
>case of the NT-style command processor) the date as "Tue 02/09/2008" for
>today, it poses more problems than it solves.
>

OK Bob - thanks for the correction (for future googlers) - that is the correct
answer which I have used and recommended in the past.
I forgot about the 8 char restriction.

Anyway (just out of curiosity) I just fired up my VBDOS (using windows 2000 and
\winnt\system32\command.com) and DATE$ give me "09-02-2008" (UK date format).
MKDIR DATE$ creates a subdirectory named "09-02-20" which of course is not what
is required.


Geo

Todd Vargo

unread,
Sep 2, 2008, 6:44:58 AM9/2/08
to
Geo wrote:

Right, the date was truncated to 8 characters by MKDIR (as mentioned above).
To create a LFN you could SHELL to the command processor.

SHELL "md " + DATE$

However, why would anyone want to use that date format? For proper sorting,
most would prefer ymd format but only a single call to DATE$ should be used.

d$ = DATE$
MKDIR RIGHT$(d$,4)+LEFT$(d$,2)+MID$(d$,4,2)

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

0 new messages