i'm trying to connect to a remote server via WMI and then establish the presence of a file on a UNC path.
is this possible using WMI and CIM_LogicalFile or CIM_DataFile? If not, how would i go about doing this?
only restriction is that it needs to be done in vb6...
what i'm currently doing is visible below, however it never seems to find anything, though the file does exist and i can access it from remote-a when logged into the terminal.
Set locator = New SWbemLocator
Set services = locator.ConnectServer("remote-a", "root\cimv2", "user", "password")
services.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate
Dim fileName As String
fileName = "\\\\remote-b\\path\\file.txt"
Set objset = services.ExecQuery("select name from CIM_LogicalFile where name='" & fileName & "'")