Exclude Files and folders while copying
Thank you for early response
But iam un able to getting i use this code like this but its copying all
files but my requirment is exclude *.txt files only
pls look at this and help me pls Sir.
waiting for u reply
Thank you
************************************************** *******
Dim objNetwork,FSO,net,Wshnetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile
strDriveLetter = "Z:"
Set objNetwork = WScript.CreateObject("WScript.Network")
objnetwork.MapNetworkDrive "Z:","\\IPADRESS\c$","True","username","passwo rd"
set fso = wscript.CreateObject("Scripting.FileSystemObject")
set folder = fso.GetFolder ("Z:\xyz")
'exclude txt files
for each file in folder.Files
if fso.GetExtensionName (file.Path) = ".txt" then
WScript.Echo file.Path & " excluded"
end if
FSO.Copyfile "Z:\xyz\*.*", "c:\abc\"
'exclude test.txt file
if file.Name = "*.txt" then
WScript.Echo file.Path & " excluded"
end if
next
objnetwork.RemoveNetworkDrive "Z:"
WScript.Echo " Drive Closed:: check: "
************************************************** ********
|