OS2 World.Com Forum

Subject  :  Creating a folder which have a date as name.
Author  :  vingfel vingfel@excite.com
Date  :  22 Mar, 2006 on 11:40
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


Subject  :  Re:Creating a folder which have a date as name.
Author  :  warpcafe warpcafe@yahoo.de
Date  :  22 Mar, 2006 on 15:54
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


Subject  :  Re:Creating a folder which have a date as name.
Author  :  vingfel vingfel@excite.com
Date  :  22 Mar, 2006 on 21:43
Yes!!!!!!

Thank you Thomas! That's what I need!


Subject  :  Re:Creating a folder which have a date as name.
Author  :  vingfel vingfel@excite.com
Date  :  22 Mar, 2006 on 22:29
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.


Subject  :  Re:Creating a folder which have a date as name.
Author  :  warpcafe warpcafe@yahoo.de
Date  :  23 Mar, 2006 on 09:12
...you're welcome.
Good to know it works for you.

Greetings
Thomas


Powered by UltraBoard 2000 <www.ub2k.com>