Results 1 to 2 of 2
  1. #1
    abhish is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Regarding the conversion of local machine path to UNC path

    I am developing a program which reads some excel file from a remote computer and stores the path in UNC format. That is <machine name>\<shared folder name or say file path starting from shared folder>\<file name>.
    I am storing the path in as local machine format right now. like wise c:\some_folder1\shared_folder\some_folder3\file.xl s. But I need to store it as comp_name\shared_folder\some_folder3\file.xls. I know how to get all other, but How would i get to know the shared folder name and change my path acc. to my requirement. Yes this to note that I also retrived the name of all the shared folder through net share, but is not able to extract the name of local shared folder name. Can any one help me out in this???


    String line = null;
    String[] commands = new String[] { "cmd", "/C", "net share" };
    Process child = Runtime.getRuntime().exec(commands);
    InputStream ins = child.getInputStream();
    BufferedReader buffReader = new BufferedReader(
    new InputStreamReader(ins));

    while (!(line = buffReader.readLine()).trim().equals(
    "The command completed successfully.")) {

    System.out.println(line);
    }

    I got the code till this much. Can anyone tell me how would i extract of my shared folder name from the list

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default Re: Regarding the conversion of local machine path to UNC path

    Where is the name available using OS commands? Is there a native program that will display the value you want? Can you ask that native program to write the values to the console where you could pipe it into a console input file.

Similar Threads

  1. Replies: 1
    Last Post: 03-05-2011, 05:47 PM
  2. setting class-path & Library Path in ubantu
    By programmer_007 in forum Eclipse
    Replies: 18
    Last Post: 02-22-2010, 12:31 PM
  3. Load class file which resides in local path c:\
    By praveen.kb in forum Advanced Java
    Replies: 2
    Last Post: 08-12-2008, 01:55 PM
  4. Getting address of Local Machine
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-24-2007, 07:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •