Before I forget, let me share with you a fantastic way to read values from Registry into a batch file variable. Say you need to determine, what is the date format of this machine. Normally you would read a value from HKEY_CURRENT_USER\Control Panel\International like this: REG QUERY "HKCU\Control Panel\International" /v sShortDate That command will produce an output similar to this: HKEY_CURRENT_USER\Control Panel\International sShortDate REG_SZ M/d/yyyy But you do not need all that. All you need is the string “M/d/yyyy” (or “yyyy-MM-dd”). To get just that string you need to skip to a second line and read third field on the last line. How you can do that in a batch…