Copy and rename files using VBScript

Copy and rename files using VBScript

Page 1 of 1

4 Replies - 27626 Views - Last Post: 17 November 2009 - 08:16 AM Rate Topic: -----

#1 kristianbolton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-November 09

Copy and rename files using VBScript

Posted 17 November 2009 - 04:55 AM

Hi

I want to copy and rename files using VBScript.

Can anybody help please?

Thanks in advance

Kristian
Is This A Good Question/Topic? 0
  • +

Replies To: Copy and rename files using VBScript

#2 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Re: Copy and rename files using VBScript

Posted 17 November 2009 - 05:12 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

my antivirus flags most vbscript actions as threatening, why'd u want to do this.

http://www.dreaminco...wtopic57525.htm
Was This Post Helpful? 0
  • +
  • -

#3 kristianbolton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-November 09

Re: Copy and rename files using VBScript

Posted 17 November 2009 - 05:23 AM

View Postolibenu, on 17 Nov, 2009 - 04:12 AM, said:

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

my antivirus flags most vbscript actions as threatening, why'd u want to do this.

http://www.dreaminco...wtopic57525.htm





Set ObjFSO = CreateObject("Scripting.FileSystemObject")
ObjFSo.CopyFile "C:\WordTest.doc","C:\WordTest_&NOW&_BRE.doc"

Thanks

Kristian
Was This Post Helpful? 0
  • +
  • -

#4 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Re: Copy and rename files using VBScript

Posted 17 November 2009 - 05:28 AM

here's a topic on it
Was This Post Helpful? 0
  • +
  • -

#5 kristianbolton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-November 09

Re: Copy and rename files using VBScript

Posted 17 November 2009 - 08:16 AM

View Postolibenu, on 17 Nov, 2009 - 04:28 AM, said:

here's a topic on it






MyNow = Replace(Now,"/","_")
MyNow = Replace(MyNow,":","_")

CopyFile
========
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\WordTest.doc" , "C:\WordTest_" & MyNow & "_BRE.doc"

Move File
=========
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\WordTest.doc" , "C:\WordTest_" & MyNow & "_BRE.doc"
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1