calling windows utilities thru java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hari Rangarajan
    New Member
    • Jan 2008
    • 1

    #1

    calling windows utilities thru java

    hello i have a problem

    i have to call the windows utility which will hlp me copy files (large ones) n folders from a cdrom to a hard disk
    the files r quite large so i cannot use the byte streams n i am trying to use the windows utilities itself

    can anybody help me
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by Hari Rangarajan
    hello i have a problem

    i have to call the windows utility which will hlp me copy files (large ones) n folders from a cdrom to a hard disk
    the files r quite large so i cannot use the byte streams n i am trying to use the windows utilities itself

    can anybody help me
    Next time try posting in the appropriate forum. You will find faster answers if you post your Java questions in Java instead of Misc.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by Hari Rangarajan
      hello i have a problem

      i have to call the windows utility which will hlp me copy files (large ones) n folders from a cdrom to a hard disk
      the files r quite large so i cannot use the byte streams n i am trying to use the windows utilities itself

      can anybody help me
      You'll need to provide more details on the windows utilities that you are trying to use.

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        Have you tried some of the new i/O features in the java.nio packages? On the other hand, why do this task in Java at all?

        Comment

        • sukatoa
          Contributor
          • Nov 2007
          • 539

          #5
          Originally posted by Hari Rangarajan
          hello i have a problem

          i have to call the windows utility which will hlp me copy files (large ones) n folders from a cdrom to a hard disk
          the files r quite large so i cannot use the byte streams n i am trying to use the windows utilities itself

          can anybody help me
          You can execute MSDOS from java....

          By using Process....

          for executing MSDOS, i used "cmd.exe /C start cmd.exe"
          for automatic transfer, i used("cmd.exe /C start "Something you could copy using DOS syntax/file transfer using COPY dos syntax");

          if you know how to transfer files from a place to another, then you could just add that code to the Process...

          if not,
          Try to run DOS and inquire for help.....
          There is a pattern there how to copy files from one location to another....
          I guess it was "COPY" or something with a parameter/s....

          Comment

          Working...