Well your application probably should be a service running under an
administrator account. Note that this account must be an adminsitrator on
_remote_ machines tooin order to use $ shares. Again I am assuming you
cannot change much regarding how the things are done on remote machines. If
you can change them it is better to devise a scheme for explicit sharing.
NetServerEnum() will help you to find all the machines. Check MSDN for the
details
Eugene
> Thanks for the reply. Before the first task you mentioned
> I need to somehow write an app that can sit on a server
> and sees all the computernames so I can then call
> RegConnectRegistry() for each machine as you suggest.
> Appeciate any thoughts. I'm going to assume/require that
> an adminsitrator will run the program.
> Dave
> >-----Original Message-----
> >Actually it is a quite good network programming question
> IMHO.
> >First task -- looking into remote registry. This is
> accomplished using
> >RegConnectRegistry API. Second task -- copying remote
> file. This is a little
> >tricky since I assume the folder in which the file is
> located is not shared.
> >Assuming your central application runs under account
> which is an
> >adminsitrator on the remote machines you can do the
> following name
> >translation
> >name at the remote machine: C:\folder\file.log
> >name at the central machine:
> \\remote_machine_name\c$\folder\file.log
> >Then you can use regular CopyFile(Ex) API to copy the
> remote file to your
> >local folder.
> >If your central application does not run under a suitable
> account you can
> >either
> >1. Ensure the folder in which the log file resides is
> always shared for
> >access by central application
> >2. Use NetUseAdd API to specify the username/password
> with which to connect
> >to the remote machine
> >Hope it helps,
> >Eugene
> >> My software is installed on multiple workstations within
> >> organizations. It produces a log file of activities in
> its
> >> local directory. I need to collect the logs, and process
> >> the information.
> >> I need to look into each workstation's registry, locate
> my
> >> file, open and grab the data, or just copy the file to
> my
> >> central app. Its under 10k per machine and would only be
> >> done rarely.
> >> I'm just after some advice on which way to go. Do I
> have
> >> to become a winsock master to do this? What is the best
> >> approach?
> >> I'm a Win32 C programmer. I haven't the faintest idea
> of
> >> the most direct approach to take in collecting these
> logs
> >> and have zero networking knowlege.
> >> I appologize for reposting this question. A suggested
> >> solution didn't really apply to networks.
> >> Dave
> >.