G
Guest
Can the Filesystemobject be used to manipulate files or folders on either a
shared drive or on a virtual directory on the web server. I had a model that
worked well in ASP but when I moved to .NET, I am getting the following error:
Error Retrieving web Root Folder: (PATH NAME) Exception from HRESULT:
0x800A004C (CTL_E_PATHNOTFOUND).
The Path I have tried using both mapped drives on the web server and virtual
directories on the web server and get the same error. Here's the code
Dim objfso As New FileSystemObject
Dim objFile As File
Dim objFolder As Folder
Dim strRootFolder As String
'Set the File System Object
objfso = Server.CreateObject("Scripting.FileSystemObject")
Try
'Connect to the path (either mapped drive or virtual directory)
strRootFolder =
ConfigurationSettings.AppSettings("BTimageFolders")
Catch ex As Exception
ErrMsg = "Error Setting strRootFolder: " & strRootFolder & " " &
ex.Message
Exit Sub
End Try
'set our folder object to the web root folder
Try
'THIS IS WHERE THE ERROR OCCURS!!!!!
objFolder = objfso.GetFolder(strRootFolder)
Catch ex As Exception
ErrMsg = "Error Retrieving Folder info: " & strRootFolder & " "
& ex.Message
Exit Sub
End Try
Any ideas would be helpful!!!
THANKS!!
shared drive or on a virtual directory on the web server. I had a model that
worked well in ASP but when I moved to .NET, I am getting the following error:
Error Retrieving web Root Folder: (PATH NAME) Exception from HRESULT:
0x800A004C (CTL_E_PATHNOTFOUND).
The Path I have tried using both mapped drives on the web server and virtual
directories on the web server and get the same error. Here's the code
Dim objfso As New FileSystemObject
Dim objFile As File
Dim objFolder As Folder
Dim strRootFolder As String
'Set the File System Object
objfso = Server.CreateObject("Scripting.FileSystemObject")
Try
'Connect to the path (either mapped drive or virtual directory)
strRootFolder =
ConfigurationSettings.AppSettings("BTimageFolders")
Catch ex As Exception
ErrMsg = "Error Setting strRootFolder: " & strRootFolder & " " &
ex.Message
Exit Sub
End Try
'set our folder object to the web root folder
Try
'THIS IS WHERE THE ERROR OCCURS!!!!!
objFolder = objfso.GetFolder(strRootFolder)
Catch ex As Exception
ErrMsg = "Error Retrieving Folder info: " & strRootFolder & " "
& ex.Message
Exit Sub
End Try
Any ideas would be helpful!!!
THANKS!!