-2
我需要你的帮助如何排除给定文件夹的特定国家文件名。在VB脚本中排除国家文件夹和文件名
DIM datasource
datasource = objRs.Fields(0).Value
Region = replace(objRs.Fields(1).Value," ","_",1,-1,0)
CountryCode = Region &"_"& serialNumber1
'-----------------------------------------------------------------
'Region subfolder creation
packageCountryDataPath = outputfolder&"\"& Region
If Not fso.FolderExists(packageCountryDataPath) Then
fso.CreateFolder(packageCountryDataPath)
WScript.Echo "Regions Folders created: " & Region & ""
End If
我想exlcude像联合国& MA只有特定国家的文件夹。我不想生成这些文件夹
Do Until objRs.EOF
datasource = objRs.Fields(0).Value
WScript.Echo datasource
Region = replace(objRs.Fields(1).Value," ","_",1,-1,0)
CountryCode = Region &"_"& serialNumber1
'-----------------------------------------------------------------
'Region subfolder creation
packageCountryDataPath = outputfolder&"\"& Region
If Not fso.FolderExists(packageCountryDataPath) Then
fso.CreateFolder(packageCountryDataPath)
WScript.Echo "Regions Folders created: " & Region & ""
End If
WScript.Echo "Regions Folders created: " & packageCountryDataPath & ""
Set folder = fso.GetFolder(Inputfile)
Set files = folder.Files
For each item In files
If Instr(item.Path,".xml") <> 0 then
logfilename =item.Name
logfilename= replace(logfilename,".xml","",1,-1,0)
returnValue = exportDatasource(item.Path,logfolder&"\"& logfilename &".log", datasource, CountryCode, DateTime, utilsfolder, packageCountryDataPath, dbDataSource, dbLogin, dbPassword)
If returnValue = 0 Then
'WScript.Echo "Datasource " & Region & " processed"
Else
WScript.Echo "Error while processing Datasource " & Region
Exit Do
End If
End If
请让我们知道如何做到这一点。
非常感谢您的帮助。
提供文件名的一些示例被包括和排除。 –
请提供[mcve]。 – Heinzi
如何定义'outputfolder'? – Icepickle