How to export to a network share using authentication
I want to export my datatable to a network share. I can export the datatable just fine to a local drive but when I try to do it to the share folder it fails.
I think the problem is a permission issue however I am not sure what syntax to use to allow QTP to save to the share.
So if I use Datatable.Export("\\servername\sharename\myfolder\ myfile") how do I identify that I have permission to save to this share?
I'm pretty sure it is a permission issue since they have everything here locked down so tight you can't access anything. Is there a way to use windows authentication to access the share when doing an export?
Re: How to export to a network share using authentication
Why not try to log yourself into the network share first and then create your paths to export your data. This should solve your problem (i hope). Here is a WMI example for you to look at....
Set Locator = CreateObject("WbemScripting.SWbemLocator")
'Connect to a remote computer, change "administrator" and 'password" to the admin logon credentials for the remote computer.
Set objWMIService = Locator.ConnectServer(strComputer,"root\cimv2","ad ministrator","password")
'Get the IP address of the remote computer
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig In IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
If IPConfig.IPAddress(i) <> "0.0.0.0" Then
ip = IPConfig.IPAddress(i)