473,725 Members | 2,118 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\folde rs\... instead of the
mapped path of "P:\folder\subf older\... 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 FileSystemObjec t 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 3572
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*******@yaho o.com> a écrit dans le message de news:
11************* ********@t31g20 00...legro ups.com...
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\folde rs\... instead of the
mapped path of "P:\folder\subf older\... 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 FileSystemObjec t 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.Fil e1.value
msgbox("Control Value: " & fsoDrive)

Set fso = CreateObject("S cripting.FileSy stemObject")
'fsoName = fso.GetDriveNam e(fsoDrive)

dim PathAndFile
PathAndFile = fso.GetAbsolute PathName(fsoDri ve)

msgbox("GetDriv eName: " & fsoName)

msgbox("Get Abs Path: " & fso.GetAbsolute PathName(fsoDri ve))

msgbox("Get Drive: " & fso.GetDrive(fs o.GetAbsolutePa thName(fsoDrive ))

msgbox(fso.GetD rive(fso.GetAbs olutePathName(f soDrive)))

Set d = fso.GetDrive(fs oName)

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
9735
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 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
1
2139
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 except form files. Their code opens fine but trying to open them in the form designer I get (for instance) "The item 'MainForm.vb' does not exist in the project directory. It
6
2399
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 allows someone to locate a file on the server, but most will use there mapped drives as they know nothing better.
3
2118
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. \\server\share, but it can't use mapped drive letters. Is there anyway I can modify it so that it can? Thanks
1
2791
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 mapped drive ever gets disconnected (remote machine reboot), the drive is disconnected. When the remote machine comes back up, the mapped drive generally stays disconnected(red x). But all it takes is a F5 keypress in explorer to make the drives...
5
1574
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 error of "Can not file specified module". Mapped drive is added to path. Thanks, Marc
0
1549
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 call from a regular Windows application, all of the drives are returned. Any thoughts on why the mapped drives are not returned when the call is made from a windows service? The windows service is running under a domain user account with admin...
1
1990
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 its behaviour change under system account, and how we can do it under system account. CFileDialog fileDlg(TRUE); fileDlg.DoModal();
2
1707
by: Lidia | last post by:
Input: A computer name on the internal network Out: Disk space total and remaining on all drives.
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2635
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.