Question

  • Creator
    Topic
  • #2149810

    Batch File Command Needed

    Locked

    by ironhead80 ·

    I have been asked to create a batch file to rename a file that we ftp on a daily basis and rename it using the current system date while also including the orginal file name as well(ie. ‘MMDDYY’TEST.TXT). I have been searching quite a bit for this but everything I seem to find doesn’t help. Can anyone help me out on this? The file is not being moved anywere out of the folder that it is downloaded too, just need it renamed so that we can keep track of each daily download. Any help is greatly appreciated.

All Answers

  • Author
    Replies
    • #2912309

      Clarifications

      by ironhead80 ·

      In reply to Batch File Command Needed

      Clarifications

    • #2912190

      VBScript

      by dan.cox ·

      In reply to Batch File Command Needed

      I think the best way to handle it is with a VBScript.

      See this example.

      Set WshFso = CreateObject(“Scripting.FileSystemObject”)
      If WshFso.FileExists(“D:\File1Test.doc”) Then
      Response = WshFso.MoveFile(“D:\File1Test.doc”, “D:\” & Year(Now) & Month(Now) & Day(Now) & “File1Test” & “.doc”)
      End If

Viewing 1 reply thread