无法从Windows服务访问UNC路径 [英] Unable to access UNC path from Windows Service

查看:348
本文介绍了无法从Windows服务访问UNC路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:Windows Server。内部版本号 - 10.0.14393.2312,Visual Studio 2017

您好,

我使用VC ++开发了一个Windows服务。我正在尝试访问UNC路径
\\edisharedstorage.file.core.windows.net\edisphere-azure-storage
请求输入用户名失败和密码。

I developed a Windows Service using VC++. I am trying to access UNC path \\edisharedstorage.file.core.windows.net\edisphere-azure-storage which is failing asking for user name and password.

如果我创建地图驱动器,我可以访问路径,例如

I can access path if I create map drive like

net use Z:\\\ \\ edisharedstorage.file.core.windows.net\edisphere-azure-storage password / USER:AZURE\userstorage / persistent:no

net use Z: \\edisharedstorage.file.core.windows.net\edisphere-azure-storage password /USER:AZURE\userstorage / persistent:no

我想知道在Windows服务中创建地图驱动器是否可以 然后再用呢?如果不是,使用UNC路径的另一种方法是什么,需要用户名和密码才能访问?

I wanted to know is it Ok to create map drive within Windows Service  then use it later? If not what is another way to use UNC path which require user name and password to access?

谢谢提前

Vijay Singh

Vijay Singh

推荐答案

在具有所需级别的用户帐户下运行Windows服务访问网络共享和基础文件系统位置。 然后服务应该能够使用UNC路径,并且不需要驱动器映射。
Run the Windows Service under a user account that has the desired level of access to the network share and the underlying file system location.  Then the service should be able to use the UNC path and no drive mapping would be necessary.


这篇关于无法从Windows服务访问UNC路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆