MSFN Forum: VBShell to move files using a wildcard - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

VBShell to move files using a wildcard Rate Topic: -----

#1 User is offline   Paxman23 

  • Group: Members
  • Posts: 1
  • Joined: 11-June 12
  • OS:none specified
  • Country: Country Flag

Posted 11 June 2012 - 06:35 PM

Hi everyone!

I've been racking my brain trying to get a small piece of code working to move a group of files across the network periodically, but I can't seem to get anything I try to work. Basically I'm moving Acronis Backup files (.TIB). The code I have shows no errors, but nothing happens.

Dim objshell
Set objshell = CreateObject("WScript.Shell")
objshell.Run "xcopy D:\Backup\*.TIB Z:\12"
objshell.Run "xcopy /y D:\Backup\.meta Z:\12"
Set objshell = Nothing

Is there a reason nothing is moving? Like I said, there's no errors so I'm not sure what I'm doing wrong. Any help would be appreciated, I'm still very new to all of this!

This post has been edited by Paxman23: 11 June 2012 - 06:46 PM



#2 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,753
  • Joined: 13-January 06

Posted 11 June 2012 - 11:22 PM

I think the problem might come from the missing "cmd.exe /c " before "xcopy..." but i would replace xcopy with robocopy which will be more reliable for this task (and it also doesn't need cmd.exe to run).

This post has been edited by allen2: 11 June 2012 - 11:23 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy