How to access a network drive from a Windows service?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a VB .NET app that lets you create a DTS Package that copies data from
an SQL Server to a database located in the specified path (it should work
with both local and network drives). You can either run the package from
within the application or as a Windows service. If I specify a network drive
and run the package from the app, the data is being copied fine, but the
service gives me "Table not accessible" error. My understanding is I have to
configure my Windows service to run with the proper domain user account. In
other words, I need to set my service to log in with an account with the
appropriate permissions to the network path I want to access. What's the
syntax for that? What functions do I have to use? I could not find any sample
code.

Thank you for help.
 
My service was able to access the network drive after I unchecked "Local
System account" and specified my network account through Administrative
Tools/Services, but is there a way to let the user specify the account
through the application?
 
Back
Top