Re: [Activetcl] UNC-path
by Matthias Hoffmann other posts by this author
Aug 8 2008 3:23AM messages near this date
view in the new Beta List Site
Re: [Activetcl] UNC-path
|
Re: [Activetcl] UNC-path
Hi,
you can do
catch {exec -- net.exe use} rc
and the parse $rc.
net use is the subcommand to create, show and delete those mappings.
Beware, there is always a lot of fun redirecting ms programs. Sometimes it works, sometimes
not; some commands return
errorlevels, some not.
Good luck!
P.S.: You can use the TWAPI extension if you need more control.
Matthias
Jeff Hobbs schrieb:
> 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
>
_______________________________________________
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
|