System (Runtime) execute command for copying the file

Can any one tell me what is wrong with this - it throws an IOException
String sourcepath = "C:"+File.separator+"pbx"+File.separator+"mantra"+File.separator+"vvvvv.mp3";
String destinationpath = "C:"+File.separator+"rrr"+File.separator+"mantra"+File.separator+"mantra.mp3";
Runtime rt=Runtime.getRuntime();
try{
String command="C:"+File.separator+"windows"+File.separator+"command /c copy "+sourcepath+" "+destinationpath;
System.out.println(command);
rt.exec(command);
}catch(IOException ex){System.out.println("exception "+ex); ex.printStackTrace();}
output:-
C:\windows\command /c copy C:\pbx\mantra\vvvvv.mp3 C:\rrr\mantra\mantra.mp3
exception java.io.IOException: CreateProcess: C:\windows\command /c copy C:\pbx\mantra\vvvvv.mp3 C:\
rrr\mantra\mantra.mp3 error=2
java.io.IOException: CreateProcess: C:\windows\command /c copy C:\pbx\mantra\vvvvv.mp3 C:\rrr\mantra
\mantra.mp3 error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at Test.main(Test.java:82)

this is clear one...
String sourcepath = "C:"+File.separator+"pbx"+File.separator+"mantra"+File.separator+"vvvvv.mp3";
String destinationpath = "C:"+File.separator+"rrr"+File.separator+"mantra"+File.separator+"mantra.mp3";
Runtime rt=Runtime.getRuntime();
try{
String command="C:"+File.separator+"windows"+File.separator+"cmd /c copy "+sourcepath+" "+destinationpath;
// String command="copy "+sourcepath+" "+destinationpath;
System.out.println(command);
rt.exec(command);
}catch(IOException ex){System.out.println("exception "+ex);
            ex.printStackTrace();}

Similar Messages

  • Music I already have on my computer will not pull up in itunes. I dragged the files, copied the files,  and even tried adding the files but nothing works. The songs play on any other program except for itunes. What do I do??

    Music I already have on my computer will not pull up in itunes. I dragged the files, copied the files,  and even tried adding the files but nothing works. The songs play on any other program except for itunes. What do I do??

    OMG......THANK YOU THANK YOU......I been reading articles after articles and nothing was working......tryed the Crtl+S and there it was. I can not thank you enough......I appricate it    Can not believe it was that simple. I am one happy person again.....

  • How i will run copy the file in oracle 7.3 ?

    how i will run copy the file in oracle 7.3.
    new version of oracle copy function is available in util_file but in oracle 7.3 this is not available.here i am using 7.3.
    please help
    Thanks
    Deepak S.

    The technique used to be to send messages from your procedure to a waiting shellscript listener using DBMS_PIPE. You would write a script (could be ksh, Perl, Ruby etc) on the server with a loop in which it connects to the database and waits for DBMS_PIPE messages. When it gets one, it executes the command that was contained in the message and loops around to continue waiting again.
    7.3 is really ancient though. If you're running it at all this far out of support it should really just be ticking over and not subject to new development.

  • How to execute command(program) from external file in Oracle SQL developer

    Hi,
    Does anyone know, Oracle SQL developer version 1.0.0.14.67 got any function that can execute command from an external file?
    Example, i have 100 insert SQL inside a text file,
    and i want to use Oracle SQL developer to execute it. How do i read from my text file? Thanks a lots.

    If you're new to Oracle, do yourself and us a favour: read some tutorials and manuals. What sqldev's worth, better download the latest version (1.1.2), lots of fixes and enhancements...
    Now for the big popper: to run an external file: @file
    Best of luck,
    K.

  • Could not copy the file "C:\Microsoft.WITDataStore.dll" because it was not found.

    Hi All,
    I need to use "Microsoft.TeamFoundation.WorkItemTracking.Common, Version=11.0.0.0" dll in my code.
    But when I try to build my application I get the below error.
    "Could not copy the file "C:\Microsoft.WITDataStore.dll" because it was not found."
    And when I try to include version 12 of the same dll , code gets build successfully. And when I try to consume the code(which uses the dll) I get
    'Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader,
    Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    The system cannot find the file specified."
    how do I go ahead with this..??
    Thanks
    Uma.K

    Hi Uma,
    You might check whether the version 11 of the assembly is referenced or added into soruce control. When use the referenced files, please use the relative path for building. If the version 11 of the assembly is not added, please add it to source control and
    make sure it's referenced correctly.
    It would be better to let us know the TFS version that you're using. And you can also use version 12 if the assembly works fine. If you have any other concerns, elaborate your scenario with more details.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Import Command for importing XML files to server

    Hi All,
    Please help me in importing the files to MDS repository.
    i am trying to import a xml file from my C:\JDeveloper903\jdevhome\jdev\myprojects\oracle\apps\ar\irec\webui to the server. i have a confusion like from where(location) i should run the command ?? is that is from $JAVA_TOP or $APPL_TOP/mds??? or local drive?
    and also i have moved my XML files from local Jdeveloper to server using FileZilla to the location /oraweb/u09/appldev2/oadev2comn/java/oracle/apps/ar/irec/webui in ASCII mode. and then i was using following command to import , from $JAVA_TOP,it says import completed , but when i check from TOAD by jdr_utils.printDocument('/oracle/apps/ar/irec/webui/DownloadPG'); it throws an error - Could not find document /oracle/apps/ar/irec/webui/DownloadPG.
    java oracle.jrad.tools.xml.importer.XMLImporter /oraweb/u09/appldev2/oadev2comn/java/oracle/apps/ar/irec/webui/DownloadPG.xml -username "apps" -password apps -dbconnection "(description=(address_list=(address=(community=tcp.world)(protocol=tcp)(host=utx001dod008.uson.usoncology.int)(port=1540)))(connect_data=(sid=OADEV2)))" -rootdir  /oraweb/u09/appldev2/oadev2comn/java/oracle/apps/ar/irec/webui
    Please suggest me the correct way of doing it..
    Your help in this regard is greatly appreciated.
    Thanks
    Praveen Reddy

    Hi,
    I believe all your questions are answered in [Oracle Application Framework Personalization Guide|http://download-uk.oracle.com/docs/cd/B25516_14/current/acrobat/115fwkpg.pdf], Chapter 9.
    To use the import tool, copy the XML file to the server. It is recommended you copy it to $APPL_TOP/<directory> (for example, $APPL_TOP/personalizations), and run the import command from this directory. For the path, you need to give the full path of the XML file you want to import (for example, if you have copied the file to $APPL_TOP/personalizations, then the path according to your first post should be $APPL_TOP/personalizations/oracle/apps/ar/irec/webui/DownloadPG.xml).
    BTW, you can import from your local PC using import.bat file.
    I would also suggest you review the following thread for similar topic.
    Deploy a custom buid OA page
    Deploy a custom buid OA page
    Regards,
    Hussein

  • Copying the file in Director Lingo

    Hi!
    I am opening a file using the openFile command in director
    but what i need is to open the file as well as copy the same file
    to a local drive.Can it be done in director and can i get code
    snippet for the same.Is there any comand in director for cpying a
    file from one location to other.If i only provide a path of the
    file then i need to copy the file to desired location.
    -Thanks

    You could also use the downloadnetthing command to copy files
    to and fro.
    Though there's enough xtras as mentioned that have more file
    handling
    functionality than Lingo has.
    Manno
    ajeet.ghule wrote:
    > Hi!
    > I am opening a file using the openFile command in
    director but what i need is
    > to open the file as well as copy the same file to a
    local drive.Can it be done
    > in director and can i get code snippet for the same.Is
    there any comand in
    > director for cpying a file from one location to other.If
    i only provide a path
    > of the file then i need to copy the file to desired
    location.
    >
    > -Thanks
    >
    Manno Bult
    [email protected]

  • How can we copy the file in to the importdp/exportdp location

    How can we copy the file in to the importdp/exportdp location after doing the import and export activity.?

    How can we copy the file in to the importdp/exportdp location after doing the import and export activity.?use Operating System command; like COPY or cp.

  • Error :No operating system credentials were set for running the program

    i am getting this error when i am trying to execute a shell script in cmc. i got the status as failed, when clicked on that failed message this is what i got
    Title: delete_month 
    Document Type: Program 
    Status Failed 
    Destination: Unmanaged Disk destination properties have been set to the chosen Job Server's defaults. 
    Owner: boadmin 
    Server Used: cms_451.ProgramJobServer 
    PID: 15010 
    Folder Path: Temp/ 
    Remote Instance: No 
    Creation Time: 12/1/2010 7:21 PM 
    Expiry: 12/1/2020 7:21 PM 
    Start Time: 12/1/2010 7:21 PM 
    End Time: 12/1/2010 7:21 PM 
    Error Message: No operating system credentials were set for running the program.
    what might be the reason

    what do u mean by pm application, i didn't get that
    we r  using boe xi 3.1 sp3.on sun solaris
    my exact scenerio  is
    I wrote a shell script to delete the reports which r one month old. the reports generated by the boe r placed in unix machine(in a specific folder for example abc) and my boe server is also on unix .I imported the the shell script into boe.I assigned the path /xx/yy/abc (the path where our reports r stored) to the arguments and i gave the working directory path as the xx/yy/bobj/bobje/data/frsinput/a0_89/ ( this is the path where my shell script is present).after giving these details i am unable to delete any of the content from that folder. I am getting the failed message when i am trying to execute the object in cmc. i am pasting the shell script as well as the error message here if any body knows anything help me. do i need to set anything in cmc or what i need to do
    this is the shell script to delete the files in the specified directory
    #!/bin/ksh
    # set -x
    if [[ $# != 1 ]]; then
       echo "Usage : $0 [Directory Path]"
       exit 0
    fi
    echo "Source directory : " $1
    # To display the list of files more than a month older
    for v_fname in $(find "$1"/ -name "*" -mtime +30 -type f)
    do
      echo "$v_fname"
    done
    # To delete the files of more than 1 month older
    find "$1"/ -name "*" -mtime +30 -type f -exec rm {} \;

  • I think the DVD player reader on my Mac is going bad. Is there a way to copy the files off of an Apple Install DVD onto an external drive and then do theinstall from the external drive?

    I think the DVD player reader on my Mac is going bad. Until I get it fixed Is there a way to copy the files off of an Apple Install DVD onto an external drive and then do theinstall from the external drive? It's ILife 11 if that makes a difference. Finder won't let me see the files to copy. I know - dumb question.
    Thanks.
    Bob

    Adding an SSD is not a simple endeavour like adding additional memory or adding another hard drive to a Mac Pro. That's probably why the option is only offered as an option at the time of purchase. Even if your Apple store was willing to install the necessary parts you will probably be paying for 1-2 hours of labor plus the cost of purchasing the necessary service parts (SSD, bracket, cables, etc) which I suspect will make the upgrade cost much higher than what it costs to add the SSD option when purchasing a new system.
    I use my system for business and need it to work reliably.  Even though I'm fairly handy with tools I would not be willing to risk damaging my system and voiding my warranty by opening my system and removing the logic board and several other parts in order to squeeze in an SSD option and attach the appropriate cables and brackets. I'm also not prepared to deal with the hassles of explaining why my system has unauthorized parts installed in the event I experience issues and need to make use of my Apple warranty. My time is valuable, so I would probably investigate external storage options, or if I needed the speed of an SSD, I would consider selling my existing system and then purchase a new system configured with an SSD.
    If you haven't already done so I suggest doing a search on 'iMac SSD installation' to see what's involved. It might help you understand why the SSD option is not offered post purchase.

  • I had to transferr my music files from one computer to another by directly copying the files from the hard drive to a new drive.  Itunes recognized the files and I was able to load in new songs.  The new songs won't sync with ipod.  Ideas?

    To copy the files I had to remove the hard drive and direct copy them to an expansion drive on another machine.  ITunes recognized the copied files and operates correctly on the computer.  I was able to download additional songs to ITunes on the computer without problem.  The IPod however will not recognize the new songs, does an abreviated sync process and gives a message that the IPod cannot sync because files are being used by another application.  It is also does not want to accept the disconnect command.  Any suggestions on how to solve the sync problem?

    how did you save the songs? can you play the songs? have you restarted the computer?

  • I can't open my iphoto library on an external disk (78 gb ntfs); if i copy the files on the iMac the file is smaller and not usable. how can i recover my photo?

    hi all,
    i'm using the last version of iPhoto and i save my library on a western digital external USB drive; the drive is formatted in NTFS; i usually use tuxera to access and browse the files.
    Unfortunately, i don't know why, i access this drive in read only mode, so iPhoto doesn't accept the library any more; i tried to copy the library on the iMac but the copied file is really smaller (54 gb instead on the 78 on the drive), and iphoto doesn't accept it.
    i need to find a solution and to recover my library, i've no other copies?!
    tuxera doesn't open any other ntfs drive i think the problem is there, but i have to finf other solutions to recover my photos.
    thank you all for any suggestion.

    This problem is entirely due to this:
    the drive is formatted in NTFS
    iPhoto needs to have the Library sitting on disk formatted Mac OS Extended (Journaled). Users with the Library sitting on disks otherwise formatted regularly report issues including, but not limited to, importing, saving edits and sharing the photos.
    Do you get any error messages when you try and copy the file back to your Mac?
    Do you have a back up?

  • A script for copying smilar files to a new location

    Hi,
    i newbies to scripting. My challenge is that I want a script to only copy files with names "similar" and not "exactly the same" as the filenames in the text file.
    For example some files have 10 letters file name like "ABC01FGH01.tif".  I have to copy file where starting letter "ABC" and middle letter "FGH" of file name are fixed, but other letters are changed.
    The script sees a file name like "ABC**FGH**.tif", it should search the source location and copy the files having filenames with at least this characters e.g. "ABC02FGH02.tif", "ABC03FGH04.tif" should be copied since it has
    contains "ABC**FGH**.tif".
    Please help.

    Learn how to use wildcards in file names.  '*' is for any number of characters and'?' is for one character.
    COPY ABC??DE???.?x? c:\target
    Start by using DIR
    DIR ABC??DEF???JK.?x?
    ¯\_(ツ)_/¯

  • I just purchased Adobe Photoshop Elements 13 but my computer is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption

    I just purchased Adobe Photoshop Elements 13 but my PC is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption code and serial numbers. Can I download the program online somewhere? If I download a trial version for instance will it allow me to enter my serial number and use it for the full program?

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Problem in copying the file

    i had created a frame in which iam getting a source file and then copies the file to certain location...the problem is when i copy a large file it is doing well for the first time but when the second time while iam copying exception occurs like this
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    iam using the code
    public static void copy(File source, File dest) throws IOException {
         FileChannel in = null, out = null;
         try {         
              in = new FileInputStream(source).getChannel();
              out = new FileOutputStream(dest).getChannel();
              long size = in.size();
              MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
              out.write(buf);
         } finally {
              if (in != null)          in.close();
              if (out != null)     out.close();
        }how to solve this

    Do you simply want to copy the file. Try, not using many non-instrictive data types, because these use many extra variables and you end up using a lot more memory than you would have req.
    Eg-
    public void copy(File source,File dest) throws IOException{
         FileInputStream fins=new FileInputStream(source);
         byte[]b=new byte[(int)fins.length()];
         fins.read(b);
         fins.close();
         FileOutputStream fos=new FileOutputStream(dest);
         fos.write(b);
         fos.close();
    }This is code is not a solution, because here i am reading all file at once. This is basically to show you a method.
    In real situation you can set the size of byte[]b to 1024, and loop util read(b); method returns -1.

Maybe you are looking for

  • Problem to copy contacts from my SIM to my BB!!! Help Please

    Hi. I have a bought a BB and I put all my contacts of the Old phone into the SIM and I try to put it in the BB following the instructions that appears in the Manual. Everything seems to work fine but suddenly all contacts disappears and the it was bl

  • Wire transfer payment set up for US

    Hi Has anybode worked on wire transfer set up for US company code ( International payments ) ? Where can I get documentation on this subject ? Regards Raj

  • By- Product - Reg

    Dear All, Plz explain me the By- Product concepts , Customisation & steps to be followed during Transactions . Regards, Suresh

  • How can we write to directly to ethernet

    Hi... How can one read/write directly from/to ethernet. Our requirment is the following. We want to put the PPP packets directly to ethernet so that solaris ppp/ip/tcp can read it and can put to the tftp application. thanks Sarika

  • Sorting In the Aperture library entitled "Photos"

    In the Aperture library entitled "Photos", is there an easy way that I can I sort all the photos according to the chronological order in which they were taken?