Accessing an NT4 shared directory programmatically 
Author Message
 Accessing an NT4 shared directory programmatically

Does anyone know of a knowledge base document or have any sample code
that shows how to access a directory on an NT4 system, where the
directory is password protected and only accessible by someone with a
user account. I have created the account and the password on the NT4
machine especially for this purpose, and i would like to write a file
into the NT4 directory from a remote machine using "FileCopy". The
remote machine has a VB6 program running and occasionally needs to
post the file to the NT4 machine.

TIA

Derrick Bulmer



Sat, 15 May 2004 04:16:17 GMT  
 Accessing an NT4 shared directory programmatically
There are several ways to do this. The easiest of which
would be to grant permissions to the users that will
perform the file copy. Otherwise YOU have to manage the
userID and password, which is often a poor and unsecure
solution.

Otherwise, the next easiest way would be to use a WNetXxx
function to connect to the share in question before
performing the copy. Just remember to disconnect :)

And yet another alternative is to use impersonation. My
January VSM article includes a file system library that
performs a file copy operation using the batch
impersonation technique. This technique requires that this
user have access to both the source and destination.

Monte Hansen
http://KillerVB.com

Quote:
>-----Original Message-----
>Does anyone know of a knowledge base document or have any
sample code
>that shows how to access a directory on an NT4 system,
where the
>directory is password protected and only accessible by
someone with a
>user account. I have created the account and the password
on the NT4
>machine especially for this purpose, and i would like to
write a file
>into the NT4 directory from a remote machine

using "FileCopy". The
Quote:
>remote machine has a VB6 program running and occasionally
needs to
>post the file to the NT4 machine.

>TIA

>Derrick Bulmer
>.



Sat, 15 May 2004 04:48:53 GMT  
 Accessing an NT4 shared directory programmatically
Thanks Monte,

Because there are many users on this network I have had to protect the
NT4 machine shared directory with a password. Its no problem copying
them over manually, I obviously know the password etc.

But

I am attempting to copy the file over 3 times a day, at 8 hour
intervals, from around the network using the VB program running on a
WIN98 machine. I am trying to copy the file into the shared directory
but because I have a password protected share it doesn't copy, I
believe. Whenever i do this manually it always pops up the password
user ID dialog box and if I enter the correct details here no problem
I can access the directory as usual. I thought there may be some
simple way of copying the file and giving the pasword with a simple
call or procedure. Thereby making it a seamless/bumpless automatic
operation. If its any easier I don't foresee any occasion where I
would have to read the details of files in the shared directory from
the remote machine. i.e. its always a one way copy. The filenames are
formed from the date and time and therefore i hopefully shouldnt
experience any "file already exists" problems.

I will have a look at the WNet function.

Reading your reply, I would be interested in reading the article, if
you could post or email it I'd be gratefull. Note the usual email spam
protection in the address. Obviously since I manage/control both
machines the user access privileges and password are no problem.

TIA




Quote:
>There are several ways to do this. The easiest of which
>would be to grant permissions to the users that will
>perform the file copy. Otherwise YOU have to manage the
>userID and password, which is often a poor and unsecure
>solution.

>Otherwise, the next easiest way would be to use a WNetXxx
>function to connect to the share in question before
>performing the copy. Just remember to disconnect :)

>And yet another alternative is to use impersonation. My
>January VSM article includes a file system library that
>performs a file copy operation using the batch
>impersonation technique. This technique requires that this
>user have access to both the source and destination.

>Monte Hansen
>http://KillerVB.com

>>-----Original Message-----
>>Does anyone know of a knowledge base document or have any
>sample code
>>that shows how to access a directory on an NT4 system,
>where the
>>directory is password protected and only accessible by
>someone with a
>>user account. I have created the account and the password
>on the NT4
>>machine especially for this purpose, and i would like to
>write a file
>>into the NT4 directory from a remote machine
>using "FileCopy". The
>>remote machine has a VB6 program running and occasionally
>needs to
>>post the file to the NT4 machine.

>>TIA

>>Derrick Bulmer



Mon, 17 May 2004 13:49:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Accessing Directory Services Programmatically

2. WSH - sharing directories ( net share)

3. Directory, share, Win2000, access rights, ADSI

4. Directories, sharing, Win2000, Access rights, ADSI

5. Programmatically Run Microsoft services setup under NT4?

6. Programmatically Run Microsoft services setup under NT4?

7. Load NT4 User Hive Programmatically

8. Load NT4 User Hive Programmatically

9. dir$ prob returning dir from NT4 share to 95 ws

10. Querying agains shared contacts programmatically...

11. Programmatically share resources

12. sharing files programmatically under NT with VB

 

 
Powered by phpBB® Forum Software