Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Identifying Drives

Posted on 2011-03-15
5
Medium Priority
?
657 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

916 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