UNC drive disconnect fails

B

Brian Cook

I have a VB6 program that maps a unc drive to run. When
shutting down the program the unc drive is not
disconnected and reports a sharing violation. we start the
program using unc \\server\shared\prog.exe. Does any one
know how to disconnect the drive in VB or when the drive
is disconnected.
 
P

Pegasus \(MVP\)

Brian Cook said:
I have a VB6 program that maps a unc drive to run. When
shutting down the program the unc drive is not
disconnected and reports a sharing violation. we start the
program using unc \\server\shared\prog.exe. Does any one
know how to disconnect the drive in VB or when the drive
is disconnected.

Make sure you have no open files on that drive.

You should be able to verify the validity of your code
by modifying it so that it connects to the share in one
line of code, then disconnects in the next line. Since
no files were opened, the drive should disconnect
straight away.
 
B

Brian Cook

-----Original Message-----



Make sure you have no open files on that drive.

You should be able to verify the validity of your code
by modifying it so that it connects to the share in one
line of code, then disconnects in the next line. Since
no files were opened, the drive should disconnect
straight away.


.
What if the VB program is started from the same unc
path. I think my problem is that drive will not be
disconnected until I exit the program and if I exit the
program I can not run the disconnect.
 
P

Pegasus \(MVP\)

Brian Cook said:
path. I think my problem is that drive will not be
disconnected until I exit the program and if I exit the
program I can not run the disconnect.

That's easily tested: Start the VB program from
somewhere else and see what happens!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top