|
|
Question : xp_commandshell
|
|
Using xp_commandshell how do I just get file/folder names without the attributes and the lines without the Drive volume information into a table?
|
Answer : xp_commandshell
|
|
exec master.dbo.xp_cmdshell "Dir C:\ /B"
use the /B "bare" parameter of the DIR command
e.g.
Insert into #temp (dataline) exec master.dbo.xp_cmdshell "Dir C:\ /B"
|
|
|
|
|