GetRuntime().exec(cmd) createprocess error=2 when trying to copy

Hi there,
Using .exe and copy methods have been covered quite allot in these forums, but I cant quite find one that shows me why this isnt working:
when I run the following code (on a windows machine)
String cmd="COPY \"" +origiFTPlocation+ "\\\\"+zipfilename+ "\" \""
+ finalLocation +  "\"";
try{
     Process run = Runtime.getRuntime().exec(cmd);
     run.waitFor();
     }catch(Exception e){System.out.print(e.getMessage());               
cmd = COPY "C:\\Documents and Settings\\psd_tmp4\\My Documents\\JavaProjX\\OWF\\origiFTPlocation\\age_v0_i0_ao.zip" "C:\\Documents and Settings\\psd_tmp4\\My Documents\\JavaProjX\\OWF\\finalLocation"I get the following error:
can not tun program "COPY": createprocess error=2, the sytem cannot find the file specified
but this works fine when copying and pasting into comand line???
I have tried converting to single slashes but get the same
Edited by: Mr_Tuition on Jan 2, 2008 8:21 AM

I don't know much about DOS-ish commands, but presumably copy is not an executable program,
but rather the cmd.exe equivalent of what's called a "shell built-in" in unix. That is, I would guess that
the command "copy" is interpreted directly by cmd.exe.
If that's the case, I see the following options:
1) Execute cmd.exe and tell it to run the copy command. This probably has its own quirks that I'm not familiar with.
2) Find a copy executable somewhere on your system and invoke that (if it exists).
3) Create a .bat file that contains the copy command and execute that.
4) Do the file copy directly in Java, without invoking Runtime.exec.

Similar Messages

  • Error -50 when trying to copy files to external hard drive.

    When trying to copy files (itunes music folder) to an external hard drive, I get the following message: Copying music failed. An unknown error occurred (-50).
    I have tried repairing disk permissions but still get the message. Any thoughts?

    Gary,
    A couple of posts referencing "error -50" seem to indicate that the error could result from a corrupted file.
    One from Kappy follows:
    Error -50 Post
    One way you could save your music to the other drive would be to do it folder by folder (dragging each artist's folder, to the other drive). I suspect you won't have many (if any) errors doing that, and if you hit the corrupted file, you can come back to that folder and see which one is bad. You could also try to drag groups of artists folders to the drive if you had quite a few. One note: If you save your files this way, you won't be saving the library, which contains all the playlists you've created...you'll have to recreate them.
    If you needed that music down the road, you could just do a File>Import from iTunes....
    Hope this helps,
    Bob

  • Windows Easy transfer , ERROR message when trying to copy settings to Win 8 PC

    I have a new hp-TouchSmart Envy 23. It has 2TB drive.
    I want to use Windows Easy Transfer to move all my settings and data from the Windows 7 machine to the new hp-TouchSmart (my older PC is hp desktop is model # m9177c and has Win 7 OS)  .
    I have used easy transfer many times and I am reasonably experienced user .
    I just cannot transfer my settings and data to my new PC. I have therefore copies all my data to the hp-TouchSmart . However I need to use Windows easy transfer to move all my settings. I have a very large number of settings , macros and much else that would take a very large amount of time to re-type.
    I get an ERROR message when I want to transfer my settings. It says I don’t have enough disk space. The file I want to transfer is only 10.5 GB (after I removed all my data). The new machine has 2TB and yet I keep getting this error.
    I have tried every possible way of transferring the settings , including : external drive; flash drive; direct wire ; easy transfer cable etc. I keep getting the same ERR message .
    I am sure Easy transfer must allow transfer from Win 7 to Win 8. BUT HOW? 
    PLEASE do help. I would really appreciate very much .
    THANK YOU
    Adam 

    This thread may be useful. 
    Windows Easy Transfer will transfer from one drive to the other to mirror the original drive.  What I suspect is happening is that the program is grabbing the D drive (recovery partition on most systems) and trying to transfer it to the new system which should also have a D drive.  If that is happening,t hen that error will be thrown.
    Try using the advanced options and view the report to see what exactly is happening and triggering the message.
    Let me know what happens. 
    The document in the thread is for a previous version of Windows, but you can search for Easy Transfer Reports from the Start screen in Windows 8.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Error Message when trying to copy a picture and save it

    Hi,
    We have just recently started having this problem. When we are trying to copy and save any pictures or screens a pop-up comes up stating one of 2 things.  One is regarding something about the remote connection or we get 'access denied'... These are not protected things we are trying to copy, it is on everything we try to copy and save. 
    Any ideas?
    Thanks!

    Satellite P205D-S8802 
    Has Vista's Service Pack 2 been installed? If you don't know, run winver.exe to find out.
    Seems like it might be a firewall issue or a service may not be started. Please follow these instructions carefully.
    1. Note the exact computer-clock time of such an error.
    2. Open Event Viewer (eventvwr.msc) and expand Windows Logs.
    3. Inspect the Application and System logs for an Error event at that exact time.
    4. Do not try to manually copy anything from there. Double-click such an entry and then click the Copy button to put the details on your clipboard.
    5. Paste that information without editing into your reply here. We need only the part down to where it says..
       Event Xml: 
    -Jerry

  • Error -36 when trying to copy AVI files from External Drive to Mac

    Hi
    Hoping for some help with a problem I appreciate others have faced.
    I bought a new video camera recently and have just tried to copy the AVI files from the first few videos to my mac but am getting the error code 36 that states the files cannot be read or written.
    The format of the camera is MS-DOS (FAT 32) but when I tried changing it to MAC OS Extended it did something to the camera so the mac could then not recognise it when I tried to re-connect it via the USB port.
    I've been able to copy the files onto my friends Windows laptop no problem so don't believe them to be corrupt.
    Have also tried the dot_clean fix but this didn't work.
    Could there be another reason for the error? Any help or advice would be much appreciated.
    Thanks

    BDAqua wrote:
    I hear 3rd Party, or HW Raid 0/1/5/10 are OK, but 6 months is the absolute most I got out of my many screaming RAID setups before they completely lost it!
    Bummer. I'm not really doing this for speed though, just for total storage volume and constant, worry-free, no-brainer back-up. I guess RIAD in general is something I need to study up on. Would a simple mirror of one 500GB drive to another (back-up) - and do that twice - be a better, more reliable way to go?
    I've used Tri-Backup3/4 for years for Backups, it's fast, automatic, reliable, works in the background if you wish...
    Back-up software always seemed to have some kind of a hiccup to it, but I'll certainly look into Tri-Backup3/4. I used to Retrospect years ago, a rather fussy thing if I recall.
    Now, on the Safe Mode boot - not a success BUT a different result!
    I got the -36 again, but this time it was the external drive FILE that errored, not the OS-resident drive.
    In other words, pre-Safe Mode the error said "...because some data in "ZillaHAL" could not be read or written." (ZillaHAL is my OS-X drive).
    In Safe, it read, "...because some data in "WinXP Pro.vmem" could not be read or written."
    "WinXP Pro.vmem" is the virtual machine file - which basically is a simple Mac volume (folder) containing all of the files to run my XP virtual machine.
    Also, this time, a file* did manage to remain on the external drive whereas before, after the error, no file at all remained.
    * a generic icon appears, but it shows a size of 16+GBs. The actual file is 18.13GB - I did manage to shrink it down the other day (from it's previous 25GB).
    Well, that's it for now. I'll be away for three days, so don't mind me if I cannot reply back for a spell.
    Thanks BD,
    mp

  • Error message when trying to copy files from memory stick to MacBookPro

    Trying to copy files from my memory stick to my MacBookPro and have started to get a crazy error message - "Attempting to copy to the disk Macintosh HD failed. You do not have enough access privileges for this operation."
    I've never had a problem before today. Any help will be welcomed!

    Try this. When the stick is mounted on your desktop, right click "Get Info" and at the bottom choose "ignore ownership on this drive." See if that works.
    Bryan

  • Error message when trying to copy a DVD with Roxio Toast v6.1.1

    I'm trying to duplicate a DVD I made via Final Cut Pro and DVD Studio Pro by using Toast Titanium ver. 6.1.1.
    About 3/4 of the way through the record process, I keep getting the following error message:
    "Couldn't complete the last command because there was an I/O error.
    Result code = -36"
    Since I made this DVD myself, I don't believe there is any copy protection or region codes embedded.
    The DVD has 2.72 GB of material on it.
    Please advise, thanks.

    Here are some things to try: Select the DVD in the Toast Copy window and choose Save as Disc Image from the File menu. When that is complete eject the DVD and insert your blank disc, choose the saved disc image with the Image File setting in the Copy window and burn your DVD.
    Alternatively, drag the VIDEO_TS folder from the source DVD to your hard drive. Choose DVD-Rom (UDF) as the format in the Toast Data window. Click New Disc. Add your VIDEO_TS folder. Click New Folder and name it AUDIO_TS. Now burn your DVD.

  • Error 36 when trying to copy itunes folder

    I am not very computer savvy and have searched for some sort of solution to this issue.  I have an ext. HD western digital and since mavericks I have had issues accessing this drive.  It is very slow.  So slow that it really doesn't work at all and I can't seem to copy files off of it anymore.  Before mavericks I put my itunes folder on this drive to save some valuable space on my imac and now can't access my music or movies in itunes.  I have tried to relocate this folder to another ext HD but I keep getting the following error. "the finder cannot complete the operation because some data in "download.m4a" cannot be read or written (error code-36)". What if any is the easiest way to make itunes a useable app again with my music and movies?  Many thanks for any help.
    Tim

    Apple Error codes - http://support.apple.com/kb/HT1618 - -36 ioErr I/O error (bummers)
    Error -36 reported when copying files to external drive - http://discussions.apple.com/message.jspa?messageID=8467699
    Error -36 and filename characteristics - http://discussions.apple.com/thread.jspa?messageID=9629287 - FAT drives may not like all Mac filenames
    AD topic on Error -36 trouble shooting - http://discussions.apple.com/thread.jspa?messageID=8586572

  • Getting error 12004 when trying to copy downloads to my iPod

    This is totally weird. Last night I rented a movie and then I save it to my iPod and play it on the TV. Done this for a long time.
    Now tonight, I rented two movies, when I tried to save them to my iPod I'd get a window that said something to the effect "unknown error (12004).
    Anyone have any clues?
    I'm thinking there's somekind of seasonal flu that the iTunes store has. Hope it will be fixed. But I'm just guessing.
    Thank you. Standing by.

    NowWhat! wrote:
    This is totally weird. Last night I rented a movie and then I save it to my iPod and play it on the TV. Done this for a long time.
    Now tonight, I rented two movies, when I tried to save them to my iPod I'd get a window that said something to the effect "unknown error (12004).
    Anyone have any clues?
    I'm thinking there's somekind of seasonal flu that the iTunes store has. Hope it will be fixed. But I'm just guessing.
    Thank you. Standing by.
    don't know if this'll help but you can try deleting the iPod.plist and iPod.pkg files (move copies to a flash drive for safekeeping first).
    restart iTunes, recreate your settings and try again.
    any luck ?

  • I get error 8062 when trying to copy files from one external hard drive to another. It starts out copying files, but after 10 minutes or so it stops and I get the error 8062. The hard drive tech support says the problem is in my Macbook Air.

    I cannot copy my doc and photos and videos from one external hard drive to a second external hard drive -- both plugged in to my MacBook Air -- I get Error 8062 and the copying (which seemed to be going on for 10 minutes) stops and nothing gets copied.
    As any Macbook Air owner knows, there is SO LITTLE storage capacity on the computer that you have to back up big files onto an external hard drive to avoid getting the other annoying error that says you have no more memory/storage capacity/whatever the proper term is, and you cannot use the computer.
    Backstory: Before this error cropped up, I had backed up lots of files to an external drive and then removed them from my computer. But then the external hard drive got corrupted and I could not access my entire photo library. Had to pay $850 to Kroll Ontrack to recover those files. I have now bought 2 new external 1 Terrabyte  hard drives as protection against another such disaster. BUT I cannot copy the files from the first hard drive where all my reovered files now sit, to another backup hard drive.
    Feeling vulnerable. Please help.
    SusaninNY

    From the menu bar, select
     ▹ System Preferences ▹ Energy Saver ▹ Power Adapter
    and uncheck the box labeled Put the hard disk(s) to sleep when possible, if it's checked.
    If the drive has more than one interface (USB, FireWire, Thunderbolt, eSATA), try one of the other interfaces.
    Check that the data cable is securely inserted at both ends.
    Try a different cable.
    If you're connecting the drive through a hub, connect it directly to a built-in port on the Mac.
    If you're connecting it directly, try a different port.
    Disconnect all other devices on the bus, or as many as possible.
    Test the drive with another Mac. Test another drive with this Mac.
    If the drive is bus-powered, but has an AC adapter, connect the adapter.
    Start up in Safe Mode and test.
    If the drive doesn't work under any of the above conditions, and if another drive does work with the same Mac, then the drive has failed. You may be able to salvage the mechanism by removing it from the enclosure and installing it in another one, or in a drive dock.

  • ITunes displaying error message when trying to copy songs to iPod

    I've been having intermittent problems with my iTunes/iPod setup since about the time I got an iPhone 3G. The problems were with syncing or not mounting correctly.
    I'm still having the mounting issues but I'm no longer able to sync my contacts at all (I don't sync anything else). I manually add/remove tracks from the iPod, but can also no longer do this.
    I have also tried resetting the iPod and restoring through iTunes. With the restore option I receive the same 'insufficient privileges' warning and it will not restore.
    I have also recently upgraded to 10.5.7 (and repaired permissions before and after).
    I'm fairly sure it's the iTunes setup on my current machine as when I use the iPod on my iMac I can easily add/remove items.
    I'm tempting to use the restore function from the iMac but am skeptical it will work because the only thing new introduced to the MacBook is the iPhone. The iPhone syncs bookmarks, contacts, some photos, applications and that's it.
    Anyone have some theories? I've read some places about the iPhoto cache being a problem but I deleted it and I'm still having the above issues. Boo.
    Thanks.

    Try this. When the stick is mounted on your desktop, right click "Get Info" and at the bottom choose "ignore ownership on this drive." See if that works.
    Bryan

  • Error -51 when trying to copy file to windows server 2012

    When I try to copy a file from OSX to windows server 2012 share, it acts like its going to start and i get a pinwheel and finder is acting slow and finally error -51. although it does seem to copy over the folder with correct name but no files inside. I had this issue on mavericks as well and now on yosemite beta. Please help!
    Jarrod

    If the drive is formatted HFS then you are limited to 32 characters on a file name. If it is formatted HFS + then you can have file names as long as 255 characters. I am not familiar withi the format you say the drive is formatted in so I can't speak to it.
    If you are receiving -50 errors that can indicate a file name that is too long OR an illegal character in the filename regardless of its length.
    If you are actually using 10.3.8 as your profile states then that may be part of the problem. Many of these problems existed in 10.3.X but were fixed in 10.4
    I remember that 10.3.8 had issues copying to external drives when there were more than a certain number of characters in a filename. I don't remember the number but for some reason 10 or 12 is what comes to mind. It caused me many problems when I would try and copy files to a Zip disk that I used to have. Since I updated to 10.4 those issues have never occured again.
    Since you know what folder the problematic files are in why not just open the folder and try to copy files one at a time. When you get to the one(s) that is a problem, change the file name to something shorter.
    A better solution would be to update to 10.4 but with 10.5 coming out sometime in the Spring of 2007 this may not be the time.

  • Error message when trying to Copy iPhoto Library

    I am trying to backup my iPhoto Library from it's location on a WD external hard drive to another WD external hard drive. The Library is 54GB in size. When I try to copy the library, it copies about 1.1GB then I get this message: "The operation cannot be completed because you do not have sufficient privileges for some of the items."
    I have used the Rebuild Photo Library to 1. Examine and repair iPhoto Library file permissions, and 2. Rebuild the iPhoto Library Database from automatic backup, and it still gives me the same message when I try to copy the Library.
    I would appreciate any help.
    Thanks

    There must be a damaged file or files somewhere in the remainder of the Library.
    Try Download iPhoto Library Manager and use its rebuild function. Set the Rebuilt Library onto the external.
    This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • Receiving ERROR meassage when trying to copy..file name too long.

    Hello.
    There is an error code number, but didn't write it down...will do so, if no-one can answer this question at the minute. I am not at the Mac at the moment, so this post is pre-emptive.
    Problem:
    If I try to copy over a folder with photoshop images onto another drive, the copy is incomplete due to the name/s of the files being too long, apparently.
    The error message says something to the effect: 'the names are too long can't complete copy'.
    The file names are about 10-12 [at most]characters in length.
    Please advise
    Chris

    If the drive is formatted HFS then you are limited to 32 characters on a file name. If it is formatted HFS + then you can have file names as long as 255 characters. I am not familiar withi the format you say the drive is formatted in so I can't speak to it.
    If you are receiving -50 errors that can indicate a file name that is too long OR an illegal character in the filename regardless of its length.
    If you are actually using 10.3.8 as your profile states then that may be part of the problem. Many of these problems existed in 10.3.X but were fixed in 10.4
    I remember that 10.3.8 had issues copying to external drives when there were more than a certain number of characters in a filename. I don't remember the number but for some reason 10 or 12 is what comes to mind. It caused me many problems when I would try and copy files to a Zip disk that I used to have. Since I updated to 10.4 those issues have never occured again.
    Since you know what folder the problematic files are in why not just open the folder and try to copy files one at a time. When you get to the one(s) that is a problem, change the file name to something shorter.
    A better solution would be to update to 10.4 but with 10.5 coming out sometime in the Spring of 2007 this may not be the time.

  • Error -34 When trying to copy digital copy of Dark Knight

    Trying to download my copy of Dark Knight and I'm getting an error that my disc is full and to empty my recycle bin???? It's empty and the only disc in is the Dark Knight.....Help!!

    I am having the same problem and it is bugging the **** out of me. I emptied my recycling bin but how do you make it so the "disk" is not full? How do I find it? If anyone can help please respond ASAP

Maybe you are looking for

  • In gmail, clicking "show trimmed content" crashes firefox

    In Gmail, when there's a long thread of conversation, and I click on "show trimmed content," the Firefox window turns white and Windows says "program is not responding." I have to force quit and restart Firefox. Can someone please help me?

  • Discussion regarding un-unmountable external drives and more..

    I have a Mac OS Extended (Journaled) formatted LaCie 2TB external USB 2.0 hard drive which I use for backup and file storage with my MBP running snow leopard. Some times when working extremely large folders at work, I actually work right of the hard

  • My iphone 6 flashes red then shuts off

    My iphone 6 will flash a red screen then shut down. When i try to turn it back on it will flash the logo a few times. what is going on? what do i need to do to get it fixed?

  • How to use Time Capsule with USB HD attached

    I recently bought a 500 mb TC, so am somewhat a newbie to it, and am already wondering if I should have bought the 1 Terrabyte model. I am trying to figure out exactly how I can use the USB HD facility on the TC. Is the point of this that I can achie

  • Header information in text files

    I have a VI which logs information every ten minutes into a text file. I want to add a header to the beginning of the file only once, not every ten minutes as with the rest of the information. How can I accomplish this.