English 中文(简体)
Windows 7文件夹共享API
原标题:Windows 7 folder sharing API

我在想在受限登录会话中是否有可能通过编程方式共享Windows 7中的文件夹:

1) NetShareAdd returns ERROR_ACCESS_DENIED. 2) Command line net share says the same. 3) But explorer has no problems creating new shares without invoking UAC. How does it do that?

任何帮助将不胜感激。

最佳回答

UAC在窗口7中的严格程度低于Vista。 视窗7 探索者是一种值得信赖的申请,这样它就会在没有万国邮联的迅速反应的情况下沉默地创造份额(你可以在控制小组改变这一行为)。

您的应用程序不是一个受信任的应用程序(虽然您信任它,但操作系统并不信任它)。可能您的应用程序也没有显式地要求管理员权限。在这种情况下,Windows 7将您的程序视为未经授权的,并拒绝访问,因此出现了错误消息。

一个解决方案可以是向您的程序添加清单,请求一个执行级别。例如,请参见通过添加清单要求应用程序进行UAC升级。但是,您的整个应用程序都将以管理员身份运行。还有一些更细粒度的解决方案。

问题回答

暂无回答




相关问题
How to read exact number of bytes from a stream (tcp) socket?

In winsock, both the sync recv and the async WSARecv complete as soon as there is data available in a stream socket, regardless of the size specified (which is only the upper limit). This means that ...

AcquireCredentialsHandle returns SEC_E_NO_CREDENTIALS

I created a self-signed certificate (created using OpenSSL) and installed it into the Certificate Store using the Certificates MMC snap-in (CertMgr.msc) on Windows Vista Ultimate. I have managed to ...

Calling Win32 EnumThreadWindows() in C#

I m trying to get a call to EnumThreadWindows working, but I always get a Wrong Parameter-Error, although my code is nearly the same as this example on pinvoke.net. I don t know why this doesn t work: ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

Handling multiple windows WIN32 API

HI I m trying to create an application in the Win32 environment containing more than one window. How do i do that? all the Win32 Tutorials on web i found only showed how to manage one window. How do i ...

Creating a thread in DllMain?

It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it won t begin until all dll s have been loaded. Since I need to make sure the thread runs before I continue, I get a ...

热门标签