user2656114
user2656114

Reputation: 970

VBScript to move all files from one folder to another

For example from \\10.10.10.10\Share\* to \\10.10.10.20\Share\*.

Can someone please help out with an example or point me in the right direction?

As simple as possible is good.

Upvotes: 2

Views: 34673

Answers (3)

Best_Where_Gives
Best_Where_Gives

Reputation: 481

Another simple solution would be

For Each file in fso
    'make moving
Next

Upvotes: 2

oldDavid
oldDavid

Reputation: 176

http://technet.microsoft.com/en-us/library/ee198719.aspx

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "\\10.10.10.10\Share\*.*" , "\\10.10.10.20\Share"

If you're moving to a location that already has files with the same names as the ones you're moving, you need to delete them from the destination first.

Upvotes: 2

Bond
Bond

Reputation: 16311

With CreateObject("Scripting.FileSystemObject")
    .MoveFile "\\10.10.10.10\Share\*.*", "\\10.10.10.20\Share\"
End With

Upvotes: 6

Related Questions