Mombu the Microsoft Forum

Mombu the Microsoft Forum > Microsoft > Windows 2003 Server (TECHNET) > Eclude Files and folders
REGISTER NOW! Search Today's Posts Mark Forums Read




Reply
 
Thread Tools Search this Thread Display Modes
1 27th April 19:58
ramanaeb묲*h(~(
External User
 
Posts: 1
Default Eclude Files and folders



copying all files,but i want exclude some files and folders pls help me any
bodu know

Thank you
Ramana

************************************************** *********
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: "
************************************************** *********
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


2 27th April 19:59
mckirahan
External User
 
Posts: 1
Default Eclude Files and folders



[snip]

Looking at one of your many previous posts on this topic,
it looks like "urkec" wrote it. Why so many new posts?

Also, "exclude" is the word, not "eclude".

What files do you want to exclude? Are they in a list?
  Reply With Quote
3 27th April 19:59
ramanaeb묲*h(~(
External User
 
Posts: 1
Default Eclude Files and folders


sorry for distrubing to giving no of mails
i want copy files from remote system in that "c:\newos\" in this so many
files like .exe and .txt and .c and .C++ but i want exclude .txt files
Thank you
ramana
  Reply With Quote
4 27th April 19:59
ramanaeb묲*h(~(
External User
 
Posts: 1
Default Eclude Files and folders


sorry for distrubing to giving no of mails
i want copy files from remote system in that "c:\XYZ\" in this so many
files like .exe and .txt and .c and .C++ but i want exclude .txt files


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: "
********************************

Thank you
ramana
"McKirahan" wrote:
  Reply With Quote
5 27th April 20:00
mckirahan
External User
 
Posts: 1
Default Eclude Files and folders


[snip]

Perhaps this snippet will help:

For Each file In folder.Files
If fso.GetExtensionName(file.Path) = "txt" Then
WScript.Echo file.Path & " excluded"
Else
fso.Copyfile file.Path, "c:\abc\"
WScript.Echo file.Path & " copied"
End If
Next
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes







Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
Also visit Ogoun the Usenet Archive
666