Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    Kalamazoo
    Posts
    42

    Question Unanswered: Problem with Batch files!!!!

    Hi,
    I am trying to write a batch file which does the following:
    1. Move all the files created on weekdays to be sorted to their respective days folder Example: Files created on Tuesday should be moved to a folder named "Tuesday"(When the batch file is run on Wednesday).
    2. Only that particular day's created files should be present in the main directory and the other files should be moved to their respective days(created days) folder!!!!!
    Could you please help me out!!!!!
    Thanks.
    A

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Use xp_cmdshall with regular dos dir, copy, etc. You can save list of files in folder to temporary or permanent table like this:

    create table #tmp(res varchar(700))
    insert #tmp
    master..xp_cmdshell 'dir myfolder'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •