Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Hardware
author message
Creating a folder which have a date as name.
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
vingfel
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 32
since: 08 Mar, 2005
1. Creating a folder which have a date as name.
Reply to this topic with quote Modify your message
On Win 2000, I can do:
md "Úte%" and it create the folder
mer. 22.03.2006
Note: My win2000 is french

On winXP, I can do:
md Úte% and it create the folder
22.03.2006

I would be really happy to do something equivelent under OS2. Usable in a script, naturally

Does someone have an idea how to do that?

Thank you for your help

Date: 22 Mar, 2006 on 11:40
warpcafe
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 350
since: 26 Nov, 2002
2. Re:Creating a folder which have a date as name.
Reply to this topic with quote Modify your message
Hi vingfel,

this can be done with a simple rexx script like:

/* create directory with date-name */
thedate = date('L')
command = 'md' || "'" || thedate || "'"
command
/* --- end of script --- */

Store that script as "mddate.cmd" for example.
I used the concatenation with quotes in order to support spaces in the directory name...

When you run it from e.g. c:\ it will create a directory
C:\22 march 2006

(For an english OS/2. In a french os/2 it should be different according to the language specific setting...)

That's a very BASIC way. You can use different arguments in the date function that represent a different date string. For example, using date('S') instead will create a folder named
C:\20060322

In order to have more options, you could install "datergf.cmd" by Ronny Flatscher (search "datergf" on hobbes and put the unzipped "datergf.cmd" into a directory of the path - I use C:\os2 for it).
That will give you even more format strings...

HTH
Thomas

Date: 22 Mar, 2006 on 15:54
vingfel
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 32
since: 08 Mar, 2005
3. Re:Creating a folder which have a date as name.
Reply to this topic with quote Modify your message
Yes!!!!!!

Thank you Thomas! That's what I need!

Date: 22 Mar, 2006 on 21:43
vingfel
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 32
since: 08 Mar, 2005
4. Re:Creating a folder which have a date as name.
Reply to this topic with quote Modify your message
I made a small modification...
I created a REXX file called "vdate.cmd", because it put the sorted date in a variable usable in a script.

Well, yes... I am more used to script than to REXX...

/* Create a variable called "vdate" with date */
thedate = date('s')
command = 'set vdate='thedate
command
/* --- end of script --- */

And then I can use the vdate variable in the script.

Date: 22 Mar, 2006 on 22:29
warpcafe
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 350
since: 26 Nov, 2002
5. Re:Creating a folder which have a date as name.
Reply to this topic with quote Modify your message
...you're welcome.
Good to know it works for you.

Greetings
Thomas

Date: 23 Mar, 2006 on 09:12
Creating a folder which have a date as name.
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004