473,508 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get Computer Name from Mapped Drives using Classic ASP

Ben
Hi, Thanks for reading this post... I am trying to get the
computer/server names from the mapped drives on the Clients PC when
they select a file from the upload "browse" button. When the user
clicks on the "Browse" button on the "<input type="File"... control and
selects a file located in one of many possible mapped drives. I want
to save the location of the file as a path as you would see when
mapping a drive. For instance, "\\server\folders\... instead of the
mapped path of "P:\folder\subfolder\... etc. Therefore, when a user
views the document they can click on the link and get access to the
file regardless of how their drives are mapped. Oh, I need to be able
to do this from classic ASP.

I attempted to use the FileSystemObject object but cannot find the
method that gives me this information. I appreciate any help on this
item.

Thanks,
Ben

Mar 20 '06 #1
2 3561
Try the Drives collection. It looks like it provide a DriveType property
that allows to know if this is a network share and the ShareName property
should provide the location.

Now is this on controlled workstations ? You won't be able to do this client
side without changing the default security settings.

Not sure of the big picture. If files are uploaded it shouldn't be a
problem. If not you could also perhaps have some problems because of
security issues (have they all access to those files ?). If you know where
are those files (such as if you want to allow users to create "shortcuts" to
public files on an intranet site), you could perhaps provide your own UI ?

If you want further help, the big picture about what you are trying to do
may help to raise new suggestions from newsgroups readers...
--
Patrice

"Ben" <bc*******@yahoo.com> a écrit dans le message de news:
11*********************@t31g2000cwb.googlegroups.c om...
Hi, Thanks for reading this post... I am trying to get the
computer/server names from the mapped drives on the Clients PC when
they select a file from the upload "browse" button. When the user
clicks on the "Browse" button on the "<input type="File"... control and
selects a file located in one of many possible mapped drives. I want
to save the location of the file as a path as you would see when
mapping a drive. For instance, "\\server\folders\... instead of the
mapped path of "P:\folder\subfolder\... etc. Therefore, when a user
views the document they can click on the link and get access to the
file regardless of how their drives are mapped. Oh, I need to be able
to do this from classic ASP.

I attempted to use the FileSystemObject object but cannot find the
method that gives me this information. I appreciate any help on this
item.

Thanks,
Ben

Mar 21 '06 #2
Ben
Thanks for the response. The clients are all controlled on the same
domain but I can't guarantee that all drives are mapped the same.
Therefore, trying to eliminate the mapped drive letter and attempting
to use the computer name. Also, I am not uploading the file just
setting a location of the attached file required for a particular form
the user is viewing. The file access permissions will be handled with
a different group.

Tried the code below but no success (I know it is ugly but was just
trying many different things.)

Dim fso
dim fsoDrive
fsoDrive = window.ssli.File1.value
msgbox("Control Value: " & fsoDrive)

Set fso = CreateObject("Scripting.FileSystemObject")
'fsoName = fso.GetDriveName(fsoDrive)

dim PathAndFile
PathAndFile = fso.GetAbsolutePathName(fsoDrive)

msgbox("GetDriveName: " & fsoName)

msgbox("Get Abs Path: " & fso.GetAbsolutePathName(fsoDrive))

msgbox("Get Drive: " & fso.GetDrive(fso.GetAbsolutePathName(fsoDrive))

msgbox(fso.GetDrive(fso.GetAbsolutePathName(fsoDri ve)))

Set d = fso.GetDrive(fsoName)

msgbox("volume name: " & d.VolumeName)

Mar 21 '06 #3

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

Similar topics

6
9678
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
1
2120
by: MC | last post by:
Hi all, I've read the various posts concerning file access on mapped drives--I think problem is different: The problem: Open a VB Winforms project from a mapped drive and all files open fine...
6
2392
by: Ricky | last post by:
My question: If I have a mapped driver letter g: that referes to \\servername\d\foldername How do I get java to convert it from g: to the real path so I can use it? I have a script that...
3
2095
by: Bonj | last post by:
I have a service which is a Windows Service, but it is running under a User account - I enter my own credentials on installing. It can access network files by specifying the full UNC path, i.e....
1
2774
by: Mark | last post by:
I posted this question some time ago, but didn't get a response. So, I'll try again. Hello, I have a VB.NET app which polls mapped drives periodically looking for files. However, if the...
5
1564
by: Marc | last post by:
I am trying to run a web service that has pre-compiled dll's that reference dll's that are on a mapped drive. The web service can not load because it does not see that mapped drive and returns an...
0
1539
by: rmckbrown | last post by:
Using .Net FW 1.1 and VB.net I am calling system.io.directory.getlogicaldrives from a windows service; however, only the local drives are returned, and not my mapped drives. When I execute the...
1
1972
by: CrimeMaster | last post by:
I have write some simple code,this code does not shows network mapped drives when we run it under system account, otherwise under user account it shows them correctly. Any body tell me why did...
2
1698
by: Lidia | last post by:
Input: A computer name on the internal network Out: Disk space total and remaining on all drives.
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
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
7067
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
7505
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
5650
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
5060
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
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
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.