Create report to check if file exists in a folder

  • Hi,

    I am having an issue where I need to create a report where a user can check if a file exists on a directory.

    I have used xp_fileexists on my query analyzer but I cannot get anything to work on the Report Manager. The reason for this report is so it can be rolled out to many users.

    Ideally, I would like to create a report where the user could enter in the file name as a parameter, this would then check 3 folders returning with a message of the whereabouts of the file or a message saying it does not exist.

    Has anyone dealt with this issue before? I have trolled the internet and I keep coming short.

    Any suggestions would be greatly appreciated.

    Regards,

    emmettjarlath

  • You should be able to pass a filename variable to a stored procedure that uses xp_cmdshell and a set of dos commands or powershell similar to this.

    http://cmille19.wordpress.com/2009/04/05/executing-powershell-in-sql-server/

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

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