HELP – VBScript

pts.
Tags:
VBScript
Hello I need a help in copying a file and renaming at the destination. I am using vbscript. Here is the situation. I have a file test.dat generated on a daily basis and sitting in the 3 different directories and the directories are 20070901, 20070902 and 20070903. I have to copy this file to a destination folder \dest and rename their as test1.csv, test2.csv and test3.csv. How can I do this? any help will be appreciated. Thx,

Answer Wiki

Thanks. We'll let you know when a new response is added.

By using the copy method.

<pre>Dim filesys,demofile, createdate
Set filesys = CreateObject(“Scripting.FileSystemObject”)
set demofile = filesys.GetFile(“c:\somefile.txt”)
demofile.Copy(“c:\projects\someotherfile.txt”) </pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following