XCOPY and ROBOCOPY hang if file is locked and Destination is network drive

Using XCOPY or ROBOCOPY to copy an Outlook .pst file while Outlook is open and has the file partially locked causes XCOPY and ROBOCOPY opertations to abort immediately and report the file as partially locked if the Destination is another drive on the same
PC or a USB drive.  But if the Destination drive is a network share (e.g.
\\Whatever\Whatever) then both XCOPY and ROBOCOPY hang forever - even after Outlook is closed and the file lock is released.  The old DOS command COPY properly recognizes the lock abd aborts regardless of the Destination location.  But COPY won't
replicate the file Create/Modify dates on the Destination location as XCOPY and ROBOCOPY do.  I'm using straight DOS from a .bat file
Anyone have any suggestions as to how to recognize this condition and avoid or correct it?  Sorry if this is the wrong forum.  I didn't know where else to post this.

I really don't know why I bother with the Microsoft forums when facing technical issues with Microsoft products. I should really just write an Adblock script that takes Google results for this site out of suggested search results.
Marking this sort of unrelated comment as an "answer" is what I've sadly come to expect of the Microsoft forums. I take it your personal worth as a moderator is measured in some way by how many such 'answers' you produce.
I, and I'm sure many others, would prefer it if you were just honest enough to say "we don't know" rather than pretend that issues don't exist like this. Trying to create an impression that you've provided help when you have not is very probably what keeps
you from ever improving these forums.
RoboCopy is NOT a script it is a system utility.  These forums are not customer support or a help desk.
The answers to this question are well known and should be asked for in the correct forum.  If you really need the answer to this particular question then just read the help for RoboCopy.  It is in there very explicitly.
When you call you PC vendor for support they will usually ask you to check to see if the PC is plugged in.  This is standard procedure. It is like pointing out to new PC users that they should also call the correct vendor and give correct information. 
Posting a utility question in a scripting forum is the same as giving bad information about your problem.  After you have more experience with the technology you will see the importance of this.
¯\_(ツ)_/¯

Similar Messages

  • XCOPY and ROBOCOPY hang if file is locked nd Destination is a network drive

    This question was first posted to the Scripting Forum.  They indcated I should switch to the Plarform Forum.  I'm hoping this is the right place.  So ...
    On my home PCs, when using XCOPY or ROBOCOPY to copy an Outlook .pst file while Outlook is open and has the file partially locked causes XCOPY and ROBOCOPY opertations to abort immediately and report the file as partially locked if the Destination is another
    drive on the same PC or a USB drive.  That's good, and is as I expect.  But if the Destination drive is a network share (e.g.
    \\Whatever\Whatever) then both XCOPY and ROBOCOPY hang forever - even when specifying zero retries in ROBOCOPY and even after Outlook is closed and the file lock is released.  The old DOS command COPY properly recognizes
    the lock and aborts regardless of the Destination location.  But COPY won't replicate the file Create/Modify dates on the Destination location as XCOPY and ROBOCOPY do.  I'm using straight DOS from a .bat file
    Anyone have any suggestions as to how to recognize this condition and avoid or correct it?

    Ivan-Liu: Thanks for your input.  The thread you referred me to looked promising, but ultimately was not a solution. 
    It focuses on ROBOCOPY and the use of an elevated command prompt. 
    First of all, as I initially reported, I found the same “hang” behavior with ROBOCOPY as with XCOPY. 
    Secondly, I prefer to avoid ROBOCOPY because one of the PCs I am trying to support is still running a version of Windows XP that does not make ROBOCOPY available to me. 
    I have not yet tried the operation when using “run as an administrator,” but my own login has administrator privilege and still exhibits the problem. 
    Moreover, the operation (both XCOPY and ROBOCOPY) always completes without issue when the .pst file is NOT locked. 
    The hang-up occurs only when I forget to close Outlook before initiating the XCOPY or ROBOCOPY operation. 
    I still need to confirm that the behavior is the same whether using a UNC pathname or a mapped drive name. 
    But my memory is that the copy operations still hang if the file is locked when the copy operation is initiated.
    The two main PCs I use are running Windows-7 (one 64-bit and one 32-bit.) 
    The .pst file in question varies, but is typically between 100MB and 400MB. 
    The behavior is consistent, regardless of size.  I have not tested the behavior with smaller .pst files or with other locked files of any size.
    I’m now of the belief that my issue relates to the specific storage solution I have in place, which consists of an external 1TB Seagate USB drive plugged into a Belkin router, which subsequently makes the drive visible to my Windows home network as a network
    drive.  I don’t know if it’s a Seagate issue or a Belkin issue. 
    I’m still working to rule out Belkin by connecting the Seagate drive directly to a PC, but have not had time to complete that test yet. 
    I suspect Belkin, though, because attempts to XCOPY or ROBOCOPY to a thumb drive will abort immediately and report the file is locked. 
    Plus, I also have a separate problem wherein certain .xlsm files copied to the Seagate drive (when it is connected to the Belkin router) always report that they are corrupt if/when I attempt to use Excel to open the Seagate copy. 
    Excel always seems to successfully “repair” the files. 
    But I’ve been unable to discover a cause for that issue too.  Testing has shown that behavior to be consistent with both UNC and mapped drive names.

  • TS1368 I'm a PC user with an itunes account for several years. I updated my itunes and now it wont open and shows me 'missing file MSVCR80.dll,and error 7(Window error 126)' keep coming up even after re-installing itunes . What should i do?

    I'm a PC user with an itunes account for several years. I updated my itunes and now it wont open and shows me 'missing file MSVCR80.dll,and error 7(Window error 126)' keep coming up even after re-installing itunes . What should i do?

    Click here and follow the instructions.
    (98897)

  • I tried down loading mozilla firefox to use as a web browser. It was downloaded 100% then when prompted to "run" the error message comes up with a red cross and the message'This file is corrupted" and won't let me proceed. What do I do now?

    I tried down loading mozilla firefox to use as a web browser. It was downloaded 100% then when prompted to "run" An error message comes up with a red cross and the message'This file is corrupted" and won't let me proceed. What do I do now?

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.<br />
    You can try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See http://kb.mozillazine.org/Unable_to_save_or_download_files

  • My  iPod touch screen says it is disabled.  Connect to iTunes.  When I connect the device to the computer a window pops up and said that the iPod is locked and I need to enter the passcode on the iPod..... I can't get it to do anything.  Any ideas?

    My  iPod touch screen says it is disabled.  Connect to iTunes.  When I connect the device to the computer a window pops up and said that the iPod is locked and I need to enter the passcode on the iPod..... I can't get it to do anything.  Any ideas?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen        
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • I bought a song, and it says the file is corrupted and will not download what should i do?

    I bought a song, and it says the file is corrupted and will not download what should i do?

    If you see the "Purchased" option on the main screen of the iTunes Store, here's what I'd do:
    1) Go into your library and delete the file if it downloaded. If not, go to your downloads and delete it from there to stop it from download.
    2) Go to the Purchased pane in the main iTunes Store section, locate the item, and try the download again.
    Also, you may wish to turn off any anti-virus or anti-malware programs before you try this again, as that sometimes is what can be blocking the download. Otherwise, contact iTunes Store Support:
    http://www.apple.com/emea/support/itunes/contact.html

  • Why am I being told that a JPEG file that I made changes to in Photoshop 6 (CS6) can't be saved?  The message I get says that either the file is locked and I don't have permission to execute this or another program is using this file.

    i recently purchased a 21.5 iMac with Yosemite (10.10.1) and was disappointed to discover that my CS6 programs are not functioning correctly.  I am unable to use the "Save As" command  when making changes to a JPEG file in Photoshop.  The message I get says that either another program is using the file or it is locked and I don't have permission to execute that command.  I'm experiencing a similar problem in Bridge when trying to move an unwanted file to the Trash.  Again, I get a message telling me that i don't have permission to do this.  Lastly, I'm unable to open any Camera Raw files.  Any suggestions?  I had no problems with the Mavericks OS on my old iMac and although it's much slower, I'm tempted to go back to using my old iMac.  At this point, I feel as if I've just wasted $2300+ (tax included). 

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    resetp
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

  • My iTunes itl file is locked and its not letting me in my itunes at all

    my itunes is locked and i cant get in

    I received the same locked error just now on OSX, and even holding down Option when launching didn't do the trick.  I ended up having to follow the instructions here which was essentially:
    Drag your iTunes Library.itl file from your iTunes folder onto your desktop
    Launch iTunes, the library will be blank
    Quit iTunes, and copy the iTunes Library.itl file back from the desktop into your iTunes folder (it will warn you that you are replacing the newer blank file, that's fine)
    Restart iTunes
    This did the trick for me though still not sure why it happened in the first place!

  • My files are locked and I can't edit them!

    What is happening?  I have DW CS4.  I am trying to edit a site have used for years - my own site!  Every file I try to open, I'm told it is locked and is View Only!  This has never happened before.  What is going on?  Help!

    If I try to download a file from the server, I get this message:
    /martypics.html - error occurred - An FTP error occurred - cannot get martypics.html.  Access denied.  The file may not exist, or there could be a permission problem.
    File activity incomplete. 1 file(s) or folder(s) were not completed.

  • Word and Excel hang "downloading" file from network drive - copy file to be able to open it

    Word or Excel hang trying to open files on a network drive maybe after an untidy close.
    Symptoms:  pick the file from a pinned entry on recent list or even direct from File!Open... or by double clicking on the file from file explorer.  Word/Excel show in the middle of the status line a comment "Downloading:filename "  
    a progress bar, that shows no progress, and a white cross on a red circle to close.  Some minutes later may Excel/Word  say could not open filename.
    I have removed any temporary copies of the file prefixed with the ~. However there are no documents shown in any document recovery pane.
    If I rename the original file the problem is still there.
    I can only clear the problem by working on a copy of the file. It works with either a new name of if the copy is used to replace the original file.
    It seems file explorer's "copy" is clearing something within the file that is causing this problem.
    I have seen the same issue with both Excel and Word documents in native Office 2010 format.
    Is there a better way to clear this issue?
    Thanks

    Hi,
    It doesn't hang/crash, does it?
    If you could provide the exact error message, it would be preferred to determine the cause.
    You can also try the steps below to modify the registry, as mentioned in this thread:
    http://social.technet.microsoft.com/Forums/en-US/ba5114e0-98dd-4b44-a078-373df8899048/word-2007-issue-slow-opening-files?forum=word
    Note your 12.0 represents Office 2007, 14.0 is for Office 2010.
    Important
    This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the
    registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry,
    http://windows.microsoft.com/en-US/windows7/Back-up-the-registry
    Word
    HKEY_CLASSES_ROOT\Word.Document.14\Shell\Open\Command                
    Rename Subkey “Command” to “Old_Command”                
    Rename Key “ddeexec” to “Old_ddeexec”
    Using FileType Manager change .xls from Word.Sheet.8 to Word.Sheet.14 In the Open Command append “%1” 
    .docx In the Open Command append “%1” 
    Excel
    HKEY_CLASSES_ROOT\Excel.Document.14\Shell\Open\Command                
    Rename Subkey “Command” to “Old_Command”                
    Rename Key “ddeexec” to “Old_ddeexec”
    Using FileType Manager change .xls from Excel.Sheet.8 to Excel.Sheet.14 In the Open Command append “%1” 
    .xlsx In the Open Command append “%1”
    If the issue persists, you can also read this KB below and let me know if it is helpful:
    http://support.microsoft.com/kb/313937/en-us
    Regards,
    Melon Chen
    TechNet Community Support

  • Time machine restored files are locked and can't unlock them

    After upgrading to an SSD, i was having problems with restoring files from Timemachine. i fiexed that by naming my ssd drive the same as the drive that was backedup using time machine. now, i can't seem to edite any of the files restored in Documents from the backup. not can i edit or add content inside the folders withing documents. i dont know whats going on. they appear lock and there is no way to unlock them. it says i will need to duplicate the items!
    i'll run a permissions verify once. in the mainwhile, if u guys know about this please let me know. thanks.
    Neerav

    Stay calm!
    Ok- saying 'locked' besides their name when you open it is Lion-speak for the fact that it hasn't been edited in a while. It should, once you try and edit it, pop up a dialogue offering you the chance to duplicate or unlock the file. In the instance that the second option isn't available, try some or all of the following:
    -As the poster above said, try doing a get-info (cmd i) on a file/folder and seeing if it's locked. Uncheck it if it is. If you find they are ALL locked, you can change it on multiple items at once by selecting them and pressing cmd alt i
    -If that didn't help, try looking at the permission at the bottom of the get-info pane. Does it say you have read-write access? If it doesn't, unlock these options with the little padlock at the bottom and change it so that you do.
    -You can also try going to a high-level folder (namely, one with a  lot of stuff in) and doing what I just described, then under the read-write permission hit the little cog-symbol and choose 'apply to enclosed items'. See if that helps.
    -My final suggestion would be to find a free application called ACL fix. This helps repair dodgy or messed--up permissions using a simple drag and drop interface. Download that, and drag the affected folders onto it as per the instructions. Hopefully it should fix everything up.
    Try all that, then let me know what's what

  • Indesign CS5 file keeps locking and won't save or undo

    Hi Adobe forum,
    I've recently bought Indesign CS5 and I've already had two problems in two days with the software. I've got a new macbook pro.
    The first problem was when exporting a file down to CS4 with the new IDML file format it kept sending it to the background export panel, but it then wouldn't process at all. This was annoying as i couldn't then save or cancel the exporting file. I found a way around this by first exporting a pdf and then exporting the IDML file... it seemed to get it all kickstarted. Please fix this bug Adobe.
    The second problem I've got is: I opened an Indesign CS4 file and then saved it as a different file name. I then opened this new file and as soon as i tried to make a few changes it wouldn't let me save or undo or redo anything. This was very odd, and annoying. I checked the file info and nothing was odd and permissions was read and write. Any idea how to get around this? Is there a secret unlock / lock button that I have pressed somehow?
    Let me know if anyone can help.
    Campbell

    Paka222, please start a new thread for your problem. It's not the same as the year-old problem that started this thread. (Maybe someone can lock this one?)
    I opened my CS3 files and then successfully saved them several times, but part way through a job, the file froze up and I couldn't undo or save. When I closed the file it asked me if I wanted to save so I said yes, but then it gave me the message that the file could not be saved. In one of the CS5.5 help sections it said to export as IDML file and then reopen the file if you are experiencing problems saving converted files. I did that but it did mess up the file a little (added drop shadows to a bunch of the photos that did not have drop shadows). I'm hoping this will fix the problem, but it isn't a consistent problem so I have to test it. Are you running any type of auto-activation plugins for fonts? I just set up my Fusion 3 font auto-activation plugin for CS5.5 this morning and the problem occurred on the same day. If the IDML fix does not work, I'm thinking it may be the auto-activation plugin since I've read about similar issues before with third party plugins.
    You should try exporting your CS3 files to INX and opening that in CS5.5.
    If you see a problem when you export to IDML, it most likely means that your file was corrupt from the start. I guess it could also mean you have identified a bugin the IDML export, but I think that is not the likely case.
    Given that there are known issues with Suitcase interfering with some background tasks (Preflight), it's not surprising that it might interefere with another (Export).
    When you open a new thread, please tell us your OS and version of InDesign as well.

  • I have installed iphoto 9.5.1 and now my iphoto library is locked and it says I don't have permission to fix it. anybody  have this same issue

    I have installed iphoto 9.5.1 and now my iphoto library is locked, anybody have a fix for this?

    Have you tried to restart the system? Sometimes this is caused by a running application blocking the access.
    If that does not help, look for a lock file in the iPhoto library package as described here by Terence Devlin:
    Re: The iPhoto Library is locked, on a locked disk, or you do not have permission to make changes to it. iPhoto can try to repair the permissions.

  • My 7 year old has forgotten her password and now her ipod touch is locked and says connect to itunes. I have tried to connect however it will not connect because it is locked. How can I reset her password?

    My seven year old daughter got an ipod touch a few months ago from her father. She has now forgotten her password and it has been tried too many times and so the ipod has been disabled. It now say connect to itunes. I have tried to do this with the USB cable and itunes on my computer. Unfortunately it will not work as it will not connect saying the device is locked and to enter the password.
    This is not the computer that she previously connected to and she may not be able to get access to that computer. Is there a way for us to reset the password preferably without having to restore the ipod and lose everything she has on it?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                          
    If recovery mode does not work try DFU mode.                         
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings         
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How do I read and write to text files on a remote computer's hard drive

    I would like to read and write data to a text file on a remote computer. This is easily accomplished using one of the file functions such as "write characters to file.vi". If I am already connected to the remote computer, all I need to do is specify the path to the particular file and it will work fine.
    My problem is that I want to connect to the remote computer programatically within LabVIEW (I do not want to have to use the computer's OS to establish the connection. Is there a function that I can use to do this?
    Thomas D. Schaefer
    Wells Manufacturing Corp

    Yariv,
    You should really start a new thread with a new question like this, so that more people see it. Some people look primarily at threads that have no responses yet. Also, don't post the exact same question in multiple places. Or, if you must cross-post to some other forum, make sure to mention it in your question text.
    I'm happy to be a brick in your Western Wall, but I'm not sure what the main objective is here. Is the main problem really getting access to the "X bytes received in Y seconds at Z bytes/sec" string? Or is it accomplishing the file transfer? And what OS and LabVIEW version are you running?
    I think your problem is that you the LabVIEW System Exec command does not allow for the degree of interactivity that you need if you want to issue a sequence of commands to a command-line executable. However, under Windows XP (and, presumably, other Windows versions, though I can't check), you can tell the FTP executable to use commands from a textfile script by using the -s switch, and you can override the prompts during multiple file transfers with the -i switch:
    ftp -i -s:FILEPATH SERVERNAME
    If you issue a command in this format to System Exec, and make sure to create a file at FILEPATH with your command sequence (one per line), then you should at least accomplish the FTP actions. This won't give you the transfer details in the standard output, unfortunately. However, if you just want a general sense of how much was transferred and how quickly it happened, you can code that in LabVIEW by getting the resulting file sizes and using Tick Count before and after the System Exec call to see how long the transfer took.
    Hope that helps,
    John

Maybe you are looking for