Question

Locked

Batch File Command Needed

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.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

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

Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums