How to find files and move...

  • I query a list of log files from a table and need to find them in a direcotry (c:\Log\) and move them to a central location. Does anynoe had experience?

    Thanks

  • The two options that spring to my mind are:

    (1) Use a DTS job.

    (2) use the extended stored procedure master..xp_cmdshell to run appropriate DOS commands. If you're not familiar with it, there are some good articles about this procedure within this site

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • I would suggest if doing it in a DTS package to use a VBScript step with the Scripting.FileSystemObject. There are MANY examples of doing what you asked for on Microsofts scripting site. See :

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsfsotutor.asp

    Tim C.

    //Will write code for food


    Tim C //Will code for food

  • Thanks, Thomas,

    I found the related article using xp_fileexist.

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

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