Solved

Identifying Drives

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

786 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