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

I want to assign 12.13.12.345 (Example IP) this IP address to u: drive or v: drive etc.,. How can i achieve that? And the same i need to find which IP mapped to which drive?

Replies are listed 'Best First'.
Re: Assign IP address to some drive
by BrowserUk (Patriarch) on Jun 18, 2009 at 12:57 UTC

    Some variation on subst u: \\12.13.12.345\c$ should do the trick.

    And an unadorned subst will show you which substitutions are currently in force.

    From Perl, just use the above with system or a piped open.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Assign IP address to some drive
by marto (Cardinal) on Jun 18, 2009 at 13:01 UTC

    I'm not sure I understand what you are asking here. You want to assign a drive letter to an IP address? Look at the command line net use which will show you the local drive letter and the remote path it is currently assigned to.

    You've not mentioned that you want to do this in Perl, is that your goal? If so I'm sure theres some module out there to make this easier.

    Update: I forgot to mention that you can use net use to mount remote drives, see net use /? for examples.

    Martin

      Hi Martin, Yes i would like to achieve thru perl. I need to map some server ip to some drive and i need to find the same.