Hi Everyone,
I am using the cmdshell tool to try to pull in the filenames of all excel files in a directory. My code is as follows:
For some reason it also brings in information such as drive volume, drive volume serial number, and other statistics. How do i just pull the excel file names?
Thank you in advance!
I am using the cmdshell tool to try to pull in the filenames of all excel files in a directory. My code is as follows:
Code:
Declare @Files Table ([File] varchar(250) null)
INSERT @Files ([File])
EXEC master..xp_cmdshell 'DIR C:\current\*.xls'
For some reason it also brings in information such as drive volume, drive volume serial number, and other statistics. How do i just pull the excel file names?
Thank you in advance!