unable to access share from Windows service

J

JerryK

Hi,

I have a VB.net windows service that loks up when I attempt to access a
share. The code work fine if I run it in the development environment. The
code is as follows:

Dim sharename as string = \\server\folder\sfolder1

if (not system.Io.directory.exists(sharename)) then
System.io.directory.CreateDirectory(sharename)
end if

I suspect this is a security issue, but I am running the service under my
account and I can execute this code. I can also perform the operations in a
DOS box.

Thanks,

jerry
 
S

schneider

JerryK said:
Hi,

I have a VB.net windows service that loks up when I attempt to access a
share. The code work fine if I run it in the development environment. The
code is as follows:

Dim sharename as string = \\server\folder\sfolder1

if (not system.Io.directory.exists(sharename)) then
System.io.directory.CreateDirectory(sharename)
end if

I suspect this is a security issue, but I am running the service under my
account and I can execute this code. I can also perform the operations in a
DOS box.

Thanks,

jerry

This is becaus you are not running under a user account. You can have
the service use a different account, but then you can't allow desktop
interaction.

Schneider
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top