Results 1 to 6 of 6
  1. #1
    wiki.horizon is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Angry Create folders dynamically in diff system (known path + IP)

    Hi,

    I want to create folders in a different machine . I have IP,user name,password of the 2nd system.

    How to do the same.

    Regards

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Do you have a server on the other machine that you can give instructions to and that will execute those instructions?
    If the server handles FTP then you can use that protocol to create the folders.

  3. #3
    wiki.horizon is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    Its not server.. Just a simple dev machine.

    Actually I am able to create Folders in other machine using "cmd /c mkdir" but only in main Method. But when I run the function from my app, It doesnt work. So is there anything else I am suppose to do? Runtime .. ?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    It doesnt work
    Are there any error messages?
    How are you using "cmd /c mkdir"?

    only in main Method. But when I run the function from my app,
    Sorry, this makes no sense. What is the difference between the main() method and your app?
    Most java programs use a main method to get started.

  5. #5
    wiki.horizon is offline Member
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Are there any error messages?
    How are you using "cmd /c mkdir"?


    Sorry, this makes no sense. What is the difference between the main() method and your app?
    Most java programs use a main method to get started.
    MY requirement is :
    EX:

    When a new employee is created, using his empID, I am suppose to create some folders in other machine.

    In other system, Emp folder has been shared with all the permissions.

    function :
    void createFolder() {
    String folderCreate ="cmd /c mkdir " + "\\\\192.168.1.10\\Emp\\" + location ;
    Runtime.getRuntime().exec(folderCreate);
    }

    Above method works fine when I test with Main function , folders are created based on EmpID. But When I run my application, create employee.. It fails..

    Logs- No exception found.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default

    What is the difference between your test way of running things and the way that isn't working?
    Because we have no idea...

Similar Threads

  1. System path can't be specified?
    By Indefinite Design in forum New To Java
    Replies: 0
    Last Post: 04-11-2010, 02:50 AM
  2. Replies: 1
    Last Post: 02-04-2010, 11:12 AM
  3. How to know system folder path
    By ivvgangadhar in forum New To Java
    Replies: 6
    Last Post: 11-21-2008, 08:08 AM
  4. Replies: 20
    Last Post: 12-17-2007, 03:20 PM

Posting Permissions

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