Note that there are some explanatory texts on larger screens.

plurals
  1. POCopying a file form one drive to multiple drive won't work in Eclipse IDE
    primarykey
    data
    text
    <p>I need to <strong>copy a directory form one source form multiple destination</strong>. For example, i copied a file from my <strong>C:</strong> drive and paste it into <strong>many external drives like E:,F:,G:...etc</strong>. For this process i used the following code, </p> <pre><code>set src=%~1 :Loop shift set dest=%~1 if "%dest%"=="" goto :EOF xcopy "%src%" "%dest%" /E goto Loop </code></pre> <p>i saved this code snippet as <strong>.bat in system32 folder</strong>. Then i use this command as </p> <pre><code>C:\Windows\System32&gt;mcopy C:\Users\FSSD\Desktop\Screenshot E: F: </code></pre> <p>i executed this command in my command prompt it executed successfully.</p> <p>Then i tried to implement this command in my java application.</p> <p>My java code is,</p> <pre><code>import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class MultipleCopy{ public static void main(String args[]) { String exe_Cmd = "c:/Windows/System32/mcopy C:/Users/FSSD/Desktop/Screenshot E: F:"; Runtime r = Runtime.getRuntime(); ProcessBuilder p = new ProcessBuilder(new String[] { "cmd.exe", "/C", exe_Cmd }); Process pro; try { pro = p.start(); InputStream is = pro.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { System.out.println(line); } } catch (IOException e) { // TODO Auto-generated catch block System.err.println("IO Exception" + e.getMessage()); } } } </code></pre> <p>it was executed without any errors but the files won't copied.</p> <p>My eclipse IDE's console's output is:</p> <pre><code>C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;set src=C:/Users/FSSD/Desktop/Screenshot C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;shift C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;set dest=E: C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;if "E:" == "" goto :EOF C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;xcopy "C:/Users/FSSD/Desktop/Screenshot" "E:" /E C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;goto Loop C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;shift C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;set dest=F: C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;if "F:" == "" goto :EOF C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;xcopy "C:/Users/FSSD/Desktop/Screenshot" "F:" /E C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;goto Loop C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;shift C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;set dest= C:\Users\FSSD\IndigoWorkSpace\Multi_Copy&gt;if "" == "" goto :EOF </code></pre> <p>In this, what is my mistake, how can i get the exact output. Reply me as soon as possible. Thanks in advance...!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload