Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy all BUT
Message
De
06/05/2014 05:02:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01599588
Message ID:
01599599
Vues:
86
J'aime (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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform