473,471 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting the physical path of network drive.

Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).

How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation" win api
function, but i can't find how to use it.

Please help, Rony

Oct 29 '06 #1
4 8306
dunno about WNetGetResourceInformation but probably worth looking at WMI, I
used it to resolve a UNC path to a local directory recently

"rony_16" <ro***********@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).

How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation" win api
function, but i can't find how to use it.

Please help, Rony

Oct 29 '06 #2
And do i use it?


CuriousGeorge wrote:
dunno about WNetGetResourceInformation but probably worth looking at WMI, I
used it to resolve a UNC path to a local directory recently

"rony_16" <ro***********@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).

How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation" win api
function, but i can't find how to use it.

Please help, Rony
Oct 29 '06 #3
Rony,

I have not used it for quite a few years now, but I am pretty sure that we
used "net use" command and then inspected the output - this way you will be
able to tell whether a specific UNC is attached or not...

Just type "net use" or "net use ?" in your command prompt and see whether it
solves the problem for you.

HTH

"rony_16" wrote:
And do i use it?


CuriousGeorge wrote:
dunno about WNetGetResourceInformation but probably worth looking at WMI, I
used it to resolve a UNC path to a local directory recently

"rony_16" <ro***********@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).
>
How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation" win api
function, but i can't find how to use it.
>
Please help, Rony
>

Oct 29 '06 #4
It works
Thanks,


Sergey Poberezovskiy wrote:
Rony,

I have not used it for quite a few years now, but I am pretty sure that we
used "net use" command and then inspected the output - this way you will be
able to tell whether a specific UNC is attached or not...

Just type "net use" or "net use ?" in your command prompt and see whether it
solves the problem for you.

HTH

"rony_16" wrote:
And do i use it?


CuriousGeorge wrote:
dunno about WNetGetResourceInformation but probably worth looking at WMI, I
used it to resolve a UNC path to a local directory recently
>
"rony_16" <ro***********@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).

How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation" win api
function, but i can't find how to use it.

Please help, Rony
Oct 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon | last post by:
I wonder if someone can help with this - I 'm creating an IISVirtualDirectory, and setting its Path property to the physical path I want to reference. This works fine when I have a standard file...
7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
3
by: Mr. Smith | last post by:
Hi All. I need to be able to determine the IP address a drive letter is mapped to. When a user selects a file from a file open dialog, They will, as usual, navigate to the file they want via;...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
2
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
14
by: Gianfranco | last post by:
Hi everybody, First of all, sorry for my english if it isn't perfect ;-p I have an error in an asp.net application. I have win2003 server, with iis 6. I'm developping with visual studio...
10
by: mukeshhtrivedi | last post by:
Hi, I have some MDB (MS Access 2000) files on our server. It is small application created by one of our employee long time ago. I see this application is on Network Drive G: and H: (both drive has...
0
by: rony_16 | last post by:
Hi , I am writing a program that part of than program if to add a new network drive to the user. The adding part i know how to do (by win api "WNetAddConnection2A") but i want to check first if...
4
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get...
18
by: Aaron Gray | last post by:
Has anyone got a code snippet to separate out the path components, ie drive, path, filename, and extension ? Many thanks in advance, Aaron
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.