jl66
asked on
How to get Short date and Long date format with DOS shell code
From Start->Settings->Control panel->Regional and Language Options, we can get the Short Date and Long date as wellas the other info. How to programmatically get the info out with DOS shell commands or the other programming languages?
ASKER
Thanks for reply. What I really want is to get what in the drop-down bpx (For example, English (United States) ) and get the Short date out (4/27/2009).
Here's a batch file that uses REG to extract what is setup in the registry. You can convert ENU to English (United States) but you'll need to figure out the 3 letters for each code.
@ECHO OFF
Set sShortDate=
Set sLanguage=
for /f "tokens=2,*" %%a in ('reg query "hkcu\control panel\international" ^|
find /i "sshortdate"') do Set sShortDate=%%b
for /f "tokens=2,*" %%a in ('reg query "hkcu\control panel\international" ^|
find /i "slanguage"') do Set sLanguage=%%b
ECHO Short date is %sShortDate%
ECHO Language is %sLanguage%
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you want the date formatted, or only the format itself?