get("SystemInfo", setting);
setting could be for example one of: ( //with example result)
OS // W2k, XP, Win7
Bit// 32, 64
locale// 407, 409
LocaleName// de-DE, en-US
localeID// 1031,1033
sThousand// ., ,
sDecimal// ,, .
sTime// :
sDate// ., /
uptime
active CP
HomeDrive
HomePath
SystemDrive
and like that (e.g. more form SET command)
Usage Examples:
$CommentLang = get("SystemInfo", "LocaleName");
if($CommentLang == DE) msg "Willkommen!"; ELSE msg "Hi!";
- - -
That above is for convenient, but I would also like to suggest a more general "getreg( path [,name] );"
$intern = getreg("HKEY_CURRENT_USER\Control Panel\International");
$sTime = getreg("HKEY_CURRENT_USER\Control Panel\International", "sTime");
- - -
Status Quo:
Currently we have to do a workaround with command line tools:
Code: Select all
run "cmd /c reg query ""HKCU\Control Panel\International"" /v sDecimal > %TEMP%\xy.txt",,1;
run "notepad ""%TEMP%\xy.txt""";
Code: Select all
-----------------
HKEY_CURRENT_USER\Control Panel\International
sDecimal REG_SZ ,
-----------------
Here is a example POC code to make that by a script:
Code: Select all
$ValueName = "sDecimal"; //name of the value to extract
//run command, [directory], [wait=0], [show=1]
run "cmd /c reg query ""HKCU\Control Panel\International"" /v $ValueName > %TEMP%\xyregvalue.txt",,1;
//readfile(filename, [mode], [numbytes], [codepage], [start=1])
$RegValue = readfile( "%TEMP%\xyregvalue.txt" );
//RESULT:
//RESULT:HKEY_CURRENT_USER\Control Panel\International
//RESULT: sDecimal REG_SZ ,
//RESULT:
//regexreplace(string, pattern, replacement, [matchcase])
$RegValue = regexreplace($RegValue, "<crlf>", ""); //merge lines
//RESULT: HKEY_CURRENT_USER\Control Panel\International sDecimal REG_SZ ,
$RegValue = regexreplace($RegValue, ".+$ValueName\s+\w+\s+(.+)", "$1"); //extract value
//RESULT:,
// now you can use $RegValue in your code....
text "Value of $ValueName is $RegValue";
Code: Select all
-----------------
Value of sDecimal is ,
-----------------
- - -
For reference, here are my local settings, from english win7 with german language and region settings:
( Please post yours too for different countries )
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="00000407"
"LocaleName"="de-DE"
"s1159"=""
"s2359"=""
"sCountry"="Deutschland"
"sCurrency"="€"
"sDate"="."
"sDecimal"=","
"sGrouping"="3;0"
"sLanguage"="DEU"
"sList"=";"
"sLongDate"="dddd, d. MMMM yyyy"
"sMonDecimalSep"=","
"sMonGrouping"="3;0"
"sMonThousandSep"="."
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="dd.MM.yyyy"
"sThousand"="."
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM yyyy"
"iCalendarType"="1"
"iCountry"="49"
"iCurrDigits"="2"
"iCurrency"="3"
"iDate"="1"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="0"
"iFirstWeekOfYear"="2"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="8"
"iNegNumber"="1"
"iPaperSize"="9"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"C:\Users\stefan>echo %DATE%
13.03.2014
C:\Users\stefan>echo %TIME%
15:13:22,27
.
XYplorer Beta Club