General discussion

  • Creator
    Topic
  • #2259205

    scripting question

    Locked

    by jamie schnabel ·

    I have an applicationt that creates a folder each day. The name of the folder is named with the current day (20060823). so each day it creates a folder with the day and puts a file in that folder. I want to create a script that looks for the folder with the date and moves the file in the folder to another network location. I need some help in the script on how to change the path its looking for.

All Comments

  • Author
    Replies
    • #3230762

      Reply To: scripting question

      by jamie schnabel ·

      In reply to scripting question

      Point value changed by question poster.

    • #3199633

      Reply To: scripting question

      by lowlands ·

      In reply to scripting question

      You’ll have to give me a little more info.
      Will your script need to run without any user intervention? Will it run every day and then look for yesterday’s folder, or two days ago, or all folders?

      Answer in the thread or pm me

      • #3283879

        Reply To: scripting question

        by lowlands ·

        In reply to Reply To: scripting question

        OK, so what you need is a way to determine the data, and then change the folder accordingly.
        I should have asked what scripting language you (want to) use. But below is some vbscript

        ‘create a date string that can be appended to the file name
        wscript.echo date
        strDate = date
        dateArray = Split(strdate, “/”, -1, 1)
        if len(dateArray(0)) = “1” Then
        strNewDateString = dateArray(2) & dateArray(1) & “0” & dateArray(0)
        else
        strNewDateString = dateArray(2) & dateArray(1) & dateArray(0)
        end if

        StrFolderName = “D:\” & strNewDateString

        You will have to play around a little with the folder names etc, but this would add today’s date to your folder.

        Then you can add your copy routine.

    • #3199622

      Reply To: scripting question

      by jamie schnabel ·

      In reply to scripting question

      no user intervention. It will run at 11:30pm and look for that days folder date only.

Viewing 2 reply threads