I've posted versions of this Q before, but now finally have some points to stir up activity.
Can only max at 500pts per question, but willing to shell out up to 2000 bonus points for an elegant solution that fits my criterion.
I've got a work-around for this problem, but its not as tidy as I'd like. Boiled down to the basics required:
I need to be able to extract information about a remote UNC in terms of absolute path on that machine in order to determine relativity. C:\Data is shared as \\mach1\MainData, C:\Data\Susan is shared as \\Mach1\SusanData, C:\Data\BillsStuff is shared as C:\mach1\billybobs, and C:\Data\userX, C:\data\UserY, and C:\data\misc are not shared separately.
Enumerating shares will give me the main C:\Data directory, as well as two subdirectories as different shared folders. But because of this heirarchy, I'd only be interested in looking at the C:\data directory because I can see all the stuff below it, and all of Susans and Bills data will be encapsulated within that despite them having made their own sharenames for easier access from the networked machines.
I don't want to end trying to take a snapshot of all the files and subfolders contained within the shared folders looking to determine the heirarchy. I also dont want to have to count on every time a new folder is shared, there are rules to be applied (I've been around long enough to know what types of rules work and what dont), or additional tasks for someone to do for each new share.
I need to deconvolute the UNCs for a server into local paths on that machine.
--
An idea I'm working on right now is that my program, when enumerating shares, can look for a specific file within the share, a hidden "ME_SHARE.TXT" file that contains the C:\data or C:\data\SusanData path. The problem is getting that file made -- I want the solution to be as centralized to the machine running my program. Currently, I'm checking for that file, and if it doesn't exist, sticking a hidden "ME_SHARE_NEEDED.TXT" file in the share, then throwing up a flag to prevent the program from running, and give "The server you wish to examine has unidentified shares on it. Please copy the program xxxxxxx.exe from this machine onto the server, and run it." That program will scan the localdrives on a machine, and replace all ME_SHARE_NEEDED.TXT with the ME_SHARE.TXT files with drive paths.
Problem here is that if Dan decides to make a new share, C:\data\Dan = \\mach1\Dannyboy it really isn't going to be that significant anyways, as its part of the C:\data folder! Thats a lot of work for the person running the backup program to go through, having to walk down the hall to the machine in question, copy a program from the machine they were just at, run it, then go back down the hall and rerun the program. Even if the second program, the me_share.txt maker, were already on the machine in question, the user would probably still copy it over. But this type centralized approach is required, as a new machine added to the network wouldn't have the program on it, I can't give instructions for them to install one of my programs on it when its new (one of those rules that would go ignored, I know it). Any solution that counts on a start-up application running a check every time for new shares is out (not to mention, would be time consuming for the 360 rebooting days of the year a new share isn't made)
It has to be centralized to the one machine running the backup program - if we were to suddenly add 10 machines one day, it could in one run take care of all the new machines at once, instead of having to do a complex action on 10 different machines.
---
Keeping the ME_SHARE.TXT file solution in mind, I'd need a way to generate that file on the remote UNC drive and have it know what its machine local path would be. A DIR zap.zap > me_share.txt command would generate a file with that information in it whether or not zap.zap existed. But if a DIR command is issued on a UNC path, then only the UNC path info is presented in the output.
Is there a way for me running a VB program on MACH0 to have MACH1 issue a DIR command as if it were running on that machine, so that it would be sitting in the \\mach1\Dannyboy folder running DIR to give "C:\data\dan" in the output?
What about if I tagged all the new identified shared folders with the ME_SHARE_NEEDED.TXT file and pushed the me_share.txt generator program over to the machine somewhere. Could I then have MACH1 execute that program in its own local environment, as if I were sitting at MACH1 and ran that program manually onit? It would scan for all instances of the tag file on that computer, zapping dozens of new shared folders at once.
Is there a way to have a VB program on MACH0 force MACH1 to execute code on MACH1s local environment, and not as a remote-file run on MACH0?
--
--
Windows 98 on most of the networked machines, WinME on one, Win2000 on another. I can take care of user permissions and such programmatically, I've got no problems there; you can assume that all servers are accessible to me from any machine on the network. Likely the one running my backup program will be Win98 for a while, but it could become an XP system later. Developing the program on a Win2000 machine at home and testing code with my wifes Win98 machine on our home network for Win95/WinNT flavored platforms
I'm programming in VB6.0
The solution needs to be in my program, not purchasing of a third=party program that opens doors. If there is a control to be purchased to do this job, cost could be a big factor; at some point, the inconvenient solution currently working will just have to do. So really I'm likely to reject a solution requiring a purchase of some sorts...
Also, a few other labs have expressed interest in what I'm doing and may be interested in paying just a couple dollars down the line, so a solution would have to work on multiple machines and not be a control that can only be registered once... {I'm doing this for free for my lab, as automation of this task frees up a big chunk of my time, and will allow it to be done more routinely}