XP_Cmdshell list of files

  • Hello

    I am attempting to list all of the files in a specific directory using xp_cmd shell

    EXEC master.dbo.xp_cmdshell 'DIR /B /A-D "\\[Servername]\G$\mssql data\mssql\backup"' returns "file not found", there are files in the folder backup

    EXEC master.dbo.xp_cmdshell 'DIR /B /A-D "\\[Servername]\G$\mssql data"' returns a list of files in mssql data.

    Is it an issue with the space between mssql [space] data?

    Any thoughts on how to fix this gratefull received

    Cheers

     

     

  • usually when I get this kind of error its because I misspelled something...

  • That was my initial thought also, but the spelling is fine.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply