Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21190

help with Copy Script

$
0
0
Can anybody give me any pointers on the below script I'm trying to create please, basically I'm trying search for certain folders under a parent but the general child structure is roughly the same, if exists then copy certain extensions, but not all extensions exist in all the child folders

When I run the Script I'm not getting any files copied into the "harvest" folder or any child Folders created under the Harvest folder, both Folders and files all exist when Testing this script,

very new to VB so still learning, so there is probably lot better ways of constructing the code, hopefully im going to turn this into a standalone program

Any Help Much appreciated,


Quote:

advancedPath = InputBox("Type the Application Sharepoint")
advancedDBPath = InputBox("Type the Database Folder")
harvestFolder = InputBox("Type the Harvest Folder")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject( "WScript.Shell" )

' Check if Harvest folder exist if not create
If Not objFSO.FolderExists(harvestFolder) Then
objFSO.CreateFolder(harvestFolder)
End If

'Extensions to copy
extStr = Array("*.ini", "*.pf","*.bat","*.admin","*.st","*.ver","*.propath")

If objFSO.FolderExists(advancedPath & "oalive80") Then
' Check if Oalive80 exist
If objFSO.FolderExists(advancedPath & "oalive80") = TRUE Then
objFSO.CreateFolder(harvestFolder & "oalive80")
objFSO.CopyFile advancedPath & "oalive80" & "\" & extStr, harvestFolder & "oalive80", false
objFSO.CopyFile advancedPath & "oalive80\oahfb10" & "\" & extStr, harvestFolder & "oalive80", false
End If

' Check if Oatest80 exist
If objFSO.FolderExists(advancedPath & "oatest80") = TRUE Then
objFSO.CreateFolder(harvestFolder & "oatest80")
objFSO.CopyFile advancedPath & "oatest80" & "\" & extStr, harvestFolder & "oatest80", false
End If

' Check if oplive exist
If objFSO.FolderExists(advancedPath & "oplive") = TRUE Then
objFSO.CreateFolder(harvestFolder " "oplive")
objFSO.CopyFile advancedPath & "oplive\gclib\pf" & "\" & extStr, harvestFolder & "oplive" false
End If

' Check if Live DB folder exist
If objFSO.FolderExists(advancedDBPath & "oalive80") = TRUE Then
objFSO.CreateFolder(harvestFolder & "LiveDB")
objFSO.CopyFile advancedDBPath & "oalive80\oa_data" & "\" & extStr, harvestFolder & "LiveDB", false
End If

End If

Viewing all articles
Browse latest Browse all 21190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>