Solved

Identifying Drives

Posted on 2011-03-15
5
648 Views
Last Modified: 2012-05-11
I have a vb6 application that runs on a remote desktop server.

I need to create a utility so the user can copy files back and forth from their local computer to the remote desktop server.

The users do not have access to the servers My Computer which shows both the users local and the remote desktop server’s drives.

If I use the vb6 DriveListBox it does not show the users local drives.  How can I detect these drives?
0
Comment
Question by:PhilChapmanJr
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:kbirecki
ID: 35142537
If rdp is configured to map client drives, your app could use those drive letters.  Would that work?
0
 
LVL 2

Author Comment

by:PhilChapmanJr
ID: 35142632
it's is configured to to map client dirves.  But how can i dentify the drive so I can copy files to and from it.

See screen show attached which shows how the drives look in My-Computer
Drives.jpg
0
 
LVL 11

Accepted Solution

by:
kbirecki earned 500 total points
ID: 35143607
If you want something to be generic, meaning you won't know what local client drives are available from within the RDP session, you'll have to do some discovery, such as this example: http://vbcity.com/forums/t/4311.aspx.

Or, if you know you'll always have a C: drive on the client, you can (temporarily or not) map a drive to the client system.  In DOS, you would do it like this: net use K: \\%clientname%\c$.  It is essentially mapping a share from the client (acting as a server.)

For a VB6 app, there's lot's of examples of how to do this.  Here's one:  http://www.vbforums.com/showthread.php?t=373004.  You'll just need to pick up the environment variable %clientname% to use as the server, and assume "C$" as the share.  This assumes the user in the RDP session has permissions to access the administrative share on the local computer (this is not the same as a non-administrative share, or a typical share you'd create by opening the Share properties of a drive or folder.)  You could also explicitly add a local share with limited rights.

Hope that helps.
0
 
LVL 2

Author Comment

by:PhilChapmanJr
ID: 35143682
I copied the path from MyComputer which is "\\tsclient\C\" for C: drive of the local computer and it works ok with DirListBox

Dir_B.Path = "\\tsclient\C\"
Dir_B.Refresh
DoEvents
File_B.Path = Dir_B.Path
File_B.Refresh

Thanks for the help thought
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 35143690
Glad you got it working!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question