I wrote a service that monitors filesystem changes in VB.NET 2003. It works fine with local drives and network shares if i use UNC path. When i try to use the mapped drive (Z
i get an error message that drive is invalid.
Service runs under the same account that i logon to windows with and user account has domain admin rights.
I used WMI, FSO, WNetGetConnection, WNetGetUniversalName to try to get UNC path from the mapped drive and give it to FileSystemWatcher and all of these methods work fine if executed from a windows forms app, but return nothing (do not generate an error either) when run from the service.
I am using FileSystemWatcher, and if i just give it a drive letter of the mapped drive it says drive is invalid when run from service, but when i use the same code from windows forms app FileSystemWatcher accepts the mapped drive. I thought i could at least get the UNC path from the mapped drive and give that to the FileSystemWatcher, but can't retrieve the UNC path either.
Any help for a workaround is appreciated.
Service runs under the same account that i logon to windows with and user account has domain admin rights.
I used WMI, FSO, WNetGetConnection, WNetGetUniversalName to try to get UNC path from the mapped drive and give it to FileSystemWatcher and all of these methods work fine if executed from a windows forms app, but return nothing (do not generate an error either) when run from the service.
I am using FileSystemWatcher, and if i just give it a drive letter of the mapped drive it says drive is invalid when run from service, but when i use the same code from windows forms app FileSystemWatcher accepts the mapped drive. I thought i could at least get the UNC path from the mapped drive and give that to the FileSystemWatcher, but can't retrieve the UNC path either.
Any help for a workaround is appreciated.