How to copy network files?

How to copy network files?

Post by dave » Thu, 06 Feb 2003 09:50:03



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

 
 
 

How to copy network files?

Post by Eugene Gershni » Thu, 06 Feb 2003 15:16:13


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


Quote:> 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


 
 
 

How to copy network files?

Post by dave » Thu, 06 Feb 2003 21:20:54


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

Quote:>-----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
Quote:>tricky since I assume the folder in which the file is

located is not shared.
Quote:>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
Quote:

>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

>.

 
 
 

How to copy network files?

Post by Eugene Gershni » Fri, 07 Feb 2003 14:02:54


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

> >.

 
 
 

1. How is 'network file copy' performed in the kernel

Hi all,

Can anyone explain how network file copies are performed? I understand
from the CIFS documentation that copy commands are sent to the file
server where the operation is performed. What I can't understand is
how the copy command is sent. All other file operations go through the
client's kernel as normal file operations and are intercepted by the
CIFS client that runs as a local file system. The problem is that copy
commands are not passed down the kernel driver stack.

I am assuming that the file copy code in the kernel compares the
source and destination paths and, if the request can be remoted, the
operation is sent to a networking component, bypassing the file system
driver stack. Can anyone verify this? Can I intercept this operation?

Many thanks,

        - Andy Larter

2. Native Mathematica for OS/2?

3. Network File Copy

4. LSA size

5. Network Copying a File

6. relay to exchange server

7. Network File Copy using NetBIOS Name

8. How toTurn Off Drawing Dimensions From Snapping to Center?????

9. File copy over network to VB using DCOM ?

10. MSVC - Hogging network while syncing remote files with local buffered copies

11. Bad performance copying files to network share

12. How to copy a single file to all workstations in my network?

13. Copying files over network