Hello I have a problem here with an invalid procedure call
'Option Explicit
'On Error Resume next
Dim objNetwork
Dim objFso
Dim objFolder
Dim FromShare
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
FromShare = "\\Enterprise\Depot1"
DepToShare = "\\Enterprise\Depot"
If objFso.FolderExists(FromShare) Then
Wscript.Echo("Yup, here it is!")
Else
End IF
If objFso.FolderExists("\\Enterprise\Depot") Then
'DepToShare = "\\Enterprise\Depot2"
Wscript.Echo(DepToShare)
Call DepotCopShare
Else
Wscript.Echo("This share is not valid")
End if
Set ObjFso = Nothing
Sub DepotCopShare
set objFso = CreateObject("Scripting.FileSystemObject")
Wscript.echo("Here it Is!")
This portion of the code is where I get the "Invalid Procedure call or argument"
objFso.CopyFolder FromShare, DePToShare , overwrite
End Sub
'Option Explicit
'On Error Resume next
Dim objNetwork
Dim objFso
Dim objFolder
Dim FromShare
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
FromShare = "\\Enterprise\Depot1"
DepToShare = "\\Enterprise\Depot"
If objFso.FolderExists(FromShare) Then
Wscript.Echo("Yup, here it is!")
Else
End IF
If objFso.FolderExists("\\Enterprise\Depot") Then
'DepToShare = "\\Enterprise\Depot2"
Wscript.Echo(DepToShare)
Call DepotCopShare
Else
Wscript.Echo("This share is not valid")
End if
Set ObjFso = Nothing
Sub DepotCopShare
set objFso = CreateObject("Scripting.FileSystemObject")
Wscript.echo("Here it Is!")
This portion of the code is where I get the "Invalid Procedure call or argument"
objFso.CopyFolder FromShare, DePToShare , overwrite
End Sub