CONVERT to datetime fails on Dynamic SQL - "Conversion failed when converting date and/or time from character string"
Your second example is using the /b switch which only returns file names, but not any date information.  Removing the /b should fix the problem.