Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy all BUT
Message
From
06/05/2014 05:02:40
 
 
To
05/05/2014 18:46:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01599588
Message ID:
01599599
Views:
85
Likes (1)
>I am copying a set of dbf files from one computer to another on a regular basis.
>I want ALL dbf files transferred but one: 'nomove.dbf'
>Is there a way to modify the command below to include all dbf files but the nomove.dbf
>If not any suggestions would be greatly appreciated.
>
>tnx
>k
>
>Copy File c:\mydir\*.Dbf To \\computer2\dir2
>
You can use robocopy
	local sourceFolder, destinationFolder, filesToCopy, excludeFiles
	sourceFolder = 'd:\tmp\socsec'
	destinationFolder = 'd:\tmp\socsecCopy'
	filesToCopy = '*.*'
	excludeFiles = 'Div2014.txt'  && or '*.txt'
	
	local cmd
	
	cmd= 'robocopy "' + m.sourceFolder + '" "' + m.destinationFolder + '"'
	cmd = m.cmd + ' ' + m.filesToCopy + ' /XF ' + m.excludeFiles 
	
	
	local wshShell 
	wshShell = CreateObject("WScript.Shell")
	
	=wshShell.Run(m.cmd, 0, .t.)
the Run method http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.84).aspx

Robocopy

use /XD to exclude directories
see here http://technet.microsoft.com/en-us/library/cc733145.aspx
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform