DIR /4 doesn't work?

A

ajs2004

According to HELP DIR,

/4 Displays four-digit year

But as far as I can see, this isn't true. Regardless of the /4 option,
I get a date style dictated by Control Panel / Regional and Language
Options 'Short date' format.

Is there a way around this? I want my script to get a four-digit year
for its purpose, whatever preferences users may have set for theirs.

Andrew
________________________________________________

D:\>dir /4 blah.txt
Volume in drive D is User
Volume Serial Number is 5E15-1E91

Directory of D:\

18/10/05 12:00 63 blah.txt
1 File(s) 63 bytes
0 Dir(s) 2,569,834,496 bytes free

D:\>
 
D

de Graff

I always force the format YYYY-MM-DD by coding this (independent of user
setting)

thedate = Date()
thedate = Year(thedate) & "-" & Right("0"&Month(thedate),2) & "-" &
Right("0"&Day(thedate),2)
 
G

Guest

At command prompt Type: "dir /4
Do not add filenames. This will change date format for all files and
directories.
Another option is to use Contol Panel / Regional and Language
Options 'Short date' format. Select "Customize" and then "Date" tab. Select Short Date format.
Good Luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top