Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I love the structure of the site. You start at the top, and drill down to what you want. Maybe I've been using Unix too long... :-) "

Geography

Where in the world do Tek-Tips members come from?
OlafDoschke (Programmer)
31 May 12 12:46
The real world problem I have is finding out which drives of the client of a remote desktop session are usb drives.

So a user logs to a windows machine from his client using mstsc, with the extended options set to map his local drives, also ones, that will be attached during the session. That works ok and is displayed in Windows Explorer as "C on \\client","D on \\\client" etc.

I need to detect these mappings from an application running in that session. So far I found out %CLIENTNAME% will give me the client connected and \\tsclient\c will be it's c drive, etc.

But I don't know how many drives there are and more important, what type they are. I tried several things already, which are not stisfying me:

1. wscript.network EnumNetWorkDrives in conjunction with shell.application Namespace() gives me the list of \\tsclient\<driveletter>, but the type returned always is network share.

2. WMI Query "SELECT * FROM Win32_Share" doesn't give me results executed for the %CLIENTNAME% computer.

3. Windows API WTSQuerySessionInformation didn't help me to retreive more client info.

4. Windows API NetShareEnum also didn't list the drives and their types for me, but maybe I need to dig deeper into the options I have and the information structures returned.

I'm a bit stuck. Is asking the user to pick a drive letter D:, E:, ... the only thing I can do to figure out what connected drives are USB drives?

Bye, Olaf.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close