Re: [Activetcl] UNC-path
by Christophe De Clercq other posts by this author
Aug 8 2008 2:28AM messages near this date
view in the new Beta List Site
Re: [Activetcl] UNC-path
|
Re: [Activetcl] UNC-path
# TWAPI example
# Show properties for a connected share
# Usage example: tclsh showmappeddrive.example DRIVE
package require twapi
if {$argc != 1} {
puts stderr "Usage: [info nameofexecutable] [info script] DRIVE:"
exit
}
set drive [lindex $argv 0]
array set driveinfo [twapi::get_mapped_share_info $drive -uncvolume -user]
puts "Drive $drive mapped to $driveinfo(-uncvolume) (as user $driveinfo(-user))"
----- Original Message ----
From: Jeff Hobbs <jeffh@[...].com>
To: jonny.schonqvist@[...].com
Cc: activetcl@[...].com
Sent: Thursday, 7 August, 2008 10:52:08 PM
Subject: Re: [Activetcl] UNC-path
jonny.schonqvist@[...].com wrote:
> How could i get the UNC-path from a mapped drive with tcl, is it possible?
>
> Example
> This is what I could read from my script at my computer
>
> M:\scripts\utillities.tcl
>
> but here is where the file really is located
>
> \\SERVER1\path\to\scripts\utillities.tcl
>
> the path "\\SERVER1\path\to" is mapped at my computer as M:
> How could I extract the UNC-path?
While Tcl understands the UNC paths (low level, it uses native Win32
APIs), the mapping is done at the OS networking layer. It is likely
that you can pull this information from the registry though.
Jeff
_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
__________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http:/
/uk.docs.yahoo.com/ymail/new.html
_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Jonny Schonqvist
Jeff Hobbs
Matthias Hoffmann
Christophe De Clercq
Richard Toohey
|