Yes you can do this. You can use xp_dirtree to get a list of files in a folder and drop the returned recordset into a table then loop through the rows in the table processing the filenames.
Hi, not to put too fine of a point on this but I would disagree with this answer. The question is can one use SQL to access a PC directory structure. SQL can only access RDBMS data. The suggested approach is not truly using SQL; where SQL consists of SELECT, CREATE, REVOKE, etc.