Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Map Local Drive Win32

by briannz556 (Beadle)
on Sep 22, 2009 at 05:38 UTC ( [id://796665]=perlquestion: print w/replies, xml ) Need Help??

briannz556 has asked for the wisdom of the Perl Monks concerning the following question:

I want to be able to map a local drive in Win32. A DOS command for this is something like:

subst w: "c:\program files\something"

Can someone guide me to a Perl equivalent?

NB: I'm familar with Win32::OLE->CreateObject("WScript.Network") and MapNetworkDrive but that doesn't feel right.

Appreciate any help.

Replies are listed 'Best First'.
Re: Map Local Drive Win32
by tokpela (Chaplain) on Sep 22, 2009 at 09:18 UTC
Re: Map Local Drive Win32
by Anonymous Monk on Sep 22, 2009 at 05:50 UTC
    system 'subst', 'w:', "C:\\program files\\something";
Re: Map Local Drive Win32
by cdarke (Prior) on Sep 22, 2009 at 08:09 UTC
    You might be able to achieve this by altering the registry instead, see Wikipedia for some hints. Win32::TieRegistry is an easy way to interface the registry.
    Watch out for peristence (or not) across reboots.
Re: Map Local Drive Win32
by ccn (Vicar) on Sep 22, 2009 at 05:51 UTC

    You may consider to call system with subst as an argument

Re: Map Local Drive Win32
by briannz556 (Beadle) on Sep 22, 2009 at 10:37 UTC
    Thanks so much guys for that help. I'll try out the many options when I'm at work tomorrow. Appreciate the time taken to help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://796665]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-23 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found