Pass a username/password when accessing a folder via VBScript

独自空忆成欢 提交于 2019-12-02 07:19:09

You have to map the share to a driveletter first, then

persistent = false
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "driveletter:", "\\server\sharename", persistent, "username", "password"

Then use the normal filesystemobject to do the copying, using the driveletter or not. Once authenticated this way it's possible to do other operations with these credentials.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!