When running the net user username /domain command in cmd, all the dates (Password last set, Password expires, Password changeable and Last logon) have a strange character before the individual dates numbers, like:
Password last set ⌠2019-⌠11-⌠27 09:22:20
When I copy and convert that character to HEX, I get E2808E (the 'LEFT-TO-RIGHT MARK' U+200E Unicode character).
What is causing this? I'm guessing it's a setting on the Active Directory server?
I'm extracting the value in a batch file:
for /f "tokens=3,4 delims= " %%f in ('net user %username% /domain ^| find /I "Password expires"') do set expire=%%f %%g
set "expireDate=%expire: =" & set "dummy=%"
echo %expireDate%
And I get:
?2019-?11-?27
find.exedoes not understand Unicode and shows?(as a common string replacement character) instead. Hence, you can use%expireDate:?=%to get a valid date… – JosefZ Dec 05 '19 at 00:39net.exe. Those Left-To-Right Mark characters appear in all dates innet.exeoutput e.g.NET STATISTICS Workstation,NET TIMEetc. Maybe an user with experience in right-to-left writing system (ANSI 1255-Hebrew or ANSI 1256-Arabic) could know more? – JosefZ Dec 06 '19 at 19:50