Solved

Identifying Drives

Posted on 2011-03-15
5
642 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now