Failed to lock variable during file move/rename

Hi,
Newbie question. I believe this is one of the most common errors. I found several of them on msdn forum itself but probably there are many ways on achieving this error? Please help.
I am trying to move and rename some images from one folder to another (and yes I have seen the blog by Rafael Salas and many others but none of them helps).
Like moving from \\server1\images\123-456.jpg to \\server2\images\123456.jpg
I am using a foreach.
Source variable is built dynamically. In the first iteration @imagePath = \\server1\images\123-456.jpg ( i checked using messagebox.show)
I have defined @remoteImagePath = \\server2\images\ (which never changes) and @revisedImageName = 123456.jpg (built dynamically in script task using string replace - also checked using messagebox.show)
In FileSystem Task, I am using  SourceVariable as @imagePath and using Expressions to define Destination as in @[User::remoteImagePath] + "\\" +  @[User::revisedImageName]
Dont know for what reason, I am getting this error
Failed to lock variable "\\server2\images\123456.jpg" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution
of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
Please advise.
Thanks.

Hi dbqasp,
The error occurs because you have set the IsDestinationPathVariable property to True, and also set the Destination property from the Expressions tab rather than the DestinationVariable property from the General tab of the File System Task. Please understand
that the value of the DestinationVariable property is generated by the Destination property. That is to say, the evaluated value of the Destination property is directly used as the DestinationVariable property. If you open the File System Task editor, you
can find that the value of DestinationVariable property is automatically set to "\\server2\images\123456.jpg" which is the value of the Destination property. Of course, it is an invalid variable name. Actually, the Destination property is usually used when
the IsDestinationPathVariable property is set to False, and we specify the File Connection Manager name in the Destination property.
In your case, you can use the following steps:
Create a new string type variable @remoteImageFullPath, and set its EvaluateAsExpression property to True, and set its expression to "@[User::remoteImagePath]+ "\\" +  @[User::revisedImageName]" (wihout quotes).
Delete the Destination property, and set the DestinationVariable property to @[User::remoteImageFullPath] from the General tab.
Regards,
Mike Yin
TechNet Community Support

Similar Messages

  • WRT610N USB port locks up during file copy

    Brand new wrt610n works like a charm except for the USB port.  We bought the router specifically for that feature and we got a small USB drive to attach to it.  Problem is, when backing up a workstation using just file copy of no more than 5G of data, the USB port hangs up.  Can't get to it via the management we interface storage tab.  The rest of the router continues to function properly.  The USB light stays on.  Disconnecting the drive from the router and reconnecting causes the USB light to go off but it doesn't come back on.  A router reset corrects the locked USB port.  The drive functions properly connected to a workstation or our DVR.
    Is this broken hardware or broken software?

    Checked the firmware for updates but nothing on this problem.  The drive is a WD 750g USB 2.0.  Tech support wants me to reflash the router just incase the firmware was corrupted.
    If that doesn't work, I suppose I could reformat the drive with the Linksys router management software.  I didn't have to do that because it recognized the drive right out of the box as FAT2.  This drive works fine attached to one fo the PCs.
    ./d

  • Mac Pro Dragging/Locking Up During File Downloading??

    Within the past week I have been experiencing a problem with my Mac Pro where it drags/locks up and delays anytime I am downloading something. For example if I am downloading something it may take me several times pushing a key when typing to get it to show up or having to click an item or button several times to get a response or for it to work. This applies in all areas or anything I try to do it is not specific to any software. This only happens when downloading though... The files are being saved to an external hard drive so there isn't a problem with hard drive space. The moment everything is downloading everything is back to normal. I have also noticed that this also happens when uploading as well??
    I have had this mac pro for about a year and half never experienced this problem before... The specs for it are 4GB RAM & 2 X 3 GHz Dual Core Processor
    Any ideas or suggestions?? Any help is greatly appreciated!! I have already tried running repair disk permissions & IceClean and neither of them corrected the problem??

    Replace and repair the external drive (might want to research make/model and compatibility).

  • Photoshop Elements 11 Organizer failed during folder / file move

    I have a large image collection, in excess of 40,000.  I'm running on a PC with Windows 7 and all updates installed.  I just purchased PSE 11 to replace PSE 10. After installing PSE 11 I converted my catalog.  That seemed to go OK.  At that point I discovered that my C: drive was almost full so I decided to move my image collection from its C: drive location to an external hard drive that had sufficient capacity.  In order to ensure the integrity of the catalog I decided that I should use the PSE 11 Organizer to move the files.  This would allow the Organizer to update the location information for the files as it moved them, although it was clear that this would take many hours to complete.  So, using Organizer I did a "drag and drop" of my image collection's root file from the C: location to the external drive which happened to be the J: drive.  Organizer appeared to be running properly so I left it to continue overnight.  The next morning I discovered that only about 2/3 of the files had been moved.  There was a very cryptic message that said the opertion could not be completed because of "...possibly unsupported files types, files with read only attributes.." etc.  I did not write down the actual message and it did not tell me where in the transfer the failure occurred.  After doing some detective work I discovered that many folders and files had been copied to the J: drive that were not appearing in the Organizer catalog and consequently were not being displayed.  Some folders had only a portion of their files copied.  Fortunately, the files were still visible and cataloged on the C: drive.  I did look at my files on the C: drive and there were some that for what ever reason had read only attributes.
    I don't have a good guess as to what was actually the root cause of the problem, but here's how I think the file movement should happen.  The selected file, files, or folders should be copied to the specified destination.  At that point they should be added to the catalog, then the files should be deleted from their original location and the catalog updated accordingly.  If an original file is read only then it can't be deleted but the attempt to delete it should be reported as an inability to delete with no consequences imposed on the files that have been placed in their new location.  The "problem" should not be promoted to the status of a serious or fatal error that causes only partial completion of the overall operation.

    Bill Junk wrote:
    I've seen a couple postings in the forum that related to catalog conversion failures and suggested that they could be avoided by running in administrative mode.  When I did my conversion is was not in administrative mode and it's certainly possible that there were files with restrictive permission settings that screwed things up.  It's also fairly likely that the catalog itself had some issues that were not detected or fixed by running a catalog repair.
    That's something I had the opportunity to test today : after a fresh install of my second copy of PSE11 on another computer (Vista), I first restored without problem a PSE11 backup from the other computer (XP). Then I tried a restore for a catalog from a PSE6 version on the second computer. The conversion failed the first time and worked the second time when run as administrator. This time, I don't think there were file types problems, since that PSE6 catalog had been restored successfully on a PSE10 version some months ago. I really don't understand that 'administrator' problem, since all my files are situated in a second internal 1 Tb drive with full access for my account ?
    I am not sure about the details of your case, but I understand you have restored exactly the same tree structure in a new J: drive. Your catalog is always accessible in its original location.
    In that case it's possible to simply create a copy of your catalog (a simple copy of the folder containing the database catalog.pseXXdb - to be found in the help menu, system info). Then you need a sqlite database management tool (I use the add-on sqlite manager in Firefox) to simply edit a single record in a table containing the identification of all drives known to the catalog. You simply edit the letter and the serial number of the drive (DOS command VOL:).
    I had a case where I had a catalog and all the media on an external drive. That external drive was assigned a different letter in different computers. Either I used the above solution, or I had to reassign drive letters in one of the computers.

  • Getting error 8 during a file move with shortcuts

    Hello,
       I am using the file move vi to move files and shortcuts from one folder to another. This works file when I am trying to move files. but when I try to move a shortcut (a file with a extension of *.lnk) the move vi fails and gets a error 8 (permission error). Why is this happening? I am assuming that a shortcut is a file, so I am treating it as a file and therefore expecting the move vi to move the shortcut from one folder to another.
    Regards,
    Kaspar

    It could be that this is related to a bug that has already been discovered and reported. Our R&D deparment is working on it. When LabVIEW copies or moves a shortcut, it actually makes a copy of the file that is the target of the shortcut. However, it adds the ".lnk" extension to the end of the file name. This causes the new file to show up like a shortcut in Windows, but it is not a shortcut. If you rename the file and remove the ".lnk", then the file (the target of the original shortcut) will open without problem.
    One workaround it to use the System Exec VI to copy the file from the Windows command line. See the attached VIs.
    Jeremy P.
    Applications Engineer
    National Instruments
    Attachments:
    Move with Command Line for LNK.vi ‏16 KB
    Copy with Command Line for LNK.vi ‏36 KB

  • InDesign CS6 "Failed to export the JPEG file. File cannot be written. Disk may be locked or full."

    I get this error "Failed to export the JPEG file. File cannot be written. Disk may be locked or full." when sending small (3"x3") and large (40"x60") files to a printer hot folder. Sometime if I close the program and restart it will let me export. What could be causing this to happen?
    I am on Windows 7 with 4GB RAM PC.

    I guess the printer is grabbing the file before it is entirely written…
    Workaround: Do not save to a hot folder. Move the files after exporting to the hot folder.
    Uwe

  • Atomic Rename using Files.move

    Hi,
    I want to rename file atomically:
    Path source = Paths.get(pathOfFile);
    Path dest = Paths.get(pathOfFile + ".txt");
    Files.move(source, dest, StandardCopyOption.ATOMIC_MOVE);
    It is documented that "AtomicMoveNotSupportedException" is thrown if the move cannot be performed as an atomic file system operation.
    Is it dependent on the operating system to throw this exception or not (e.g. in Windows it is always thrown, but in linux based systems it is never thrown).
    Or it may be thrown in both of the operating systems only in some special cases (e.g. when the target location is on a different FileStore and would require that the file be copied, or target location is associated with a different provider to this object. - javadoc of the method)
    If i always use valid relative path names, then may i be sure that i will never get this exception in both linux and windows based operating systems when renaming?
    Thanks
    Erdem

    921451 wrote:
    Is it dependent on the operating system to throw this exception or not (e.g. in Windows it is always thrown, but in linux based systems it is never thrown).
    Or it may be thrown in both of the operating systems only in some special cases (e.g. when the target location is on a different FileStore and would require that the file be copied, or target location is associated with a different provider to this object. - javadoc of the method)On any given OS, the atomic move may succeed in some cases and may give that exception in others. The example of same vs. different disk and therefore not requiring a copy vs. requiring it is a good example. Although I don't see any reason why any particular OS/FS wouldn't be allowed to throw it even for a simple non-copy move. The whole point is, "what happened on this particular attempt?" I don't think it's meant to be an indicator of overall OS/FS policy.
    If i always use valid relative path names, then may i be sure that i will never get this exception in both linux and windows based operating systems when renaming?No.
    But take a step back a minute. Any time you're doing FS operations, there's a chance they may fail for any of a number of reasons, and you have to be prepared to handle those failures. So even in cases where the underlying FS is guaranteed to support an atomic move, the move could still fail for other reasons. You have to handle a failure no matter what. The only reason you care if it's this particular exception is if you're going to handle it differently than other exceptions.
    But at the end of the day, if the method declares that it throws it, then your code has to be able to handle it.

  • Help! (please :) I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Help! (please I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Or If there is any purchased music then you can try to transfer purchases
    http://support.apple.com/kb/ht1848
    If you're in the US you can reload purchased music
    http://support.apple.com/kb/ht2519

  • AnyConnect 3.1.01065 error - Failed to install AnyConnect VPN Profile because of file move error. A VPN connection cannot be established.

    I've got a user running:
    AnyConnect 3.1.01065
    on
    Windows 7 64bit.
    Several weeks ago she started encountering the following error:
    -after logging into Windows and launching the AnyConnect client, she enters her username and password and successfully authenticates.
    -the connection is not established and she's presented with the following message: "Failed to install AnyConnect VPN Profile because of file move error. A VPN connection cannot be established."
    After doing some troubleshooting, inlcuding uninstalling/reinstalling the anyconnect client, it seems the culprit is the following file:
    C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile\<filename>.xml. When the problem occurs (which is not regularly, sometimes it occurs daily, sometimes just once a week) examining that file indicates it has no security or permissions set. Quitting the AnyConnect software, modifying the file so that the user has full control of it, then relaunching AnyConnect fixes the problem (until it happens again). Uninstalling, and making sure to move C:\ProgramData\Cisco to the trash, then reinstalling did not seem to help.
    The closest match in these forums is the following thread, https://supportforums.cisco.com/message/3760446 - though no clear resolution was given.
    Has anyone else encountered this, and been able to fix it?
    Thanks much.

    Just FYI, it seems at least in this case, purging all the previous system restore points seems to have resolved this issue...

  • How to edit move rename files in iTunes

    how to edit move rename files in itunes

    I don't like iTunes.
    I don't want iTunes to keep the physical location of my files because they can be on a SD card, or an USB drive and i don't want iTunes to stop me from playing a song because it cannot find it anymore.
    So i would like to use physical files just to upload to iTunes Match and then delete the link to the physical file.
    If needed, iTunes Match will download the file.
    The problem is just that i would like to delete all references to physical files to make iTunes Match download the file only when needed and stop using the first version i had given to it
    maybe i could have a Apple Script to check if there is a physical file referenced and if so delete it to have only the Cloud version     

  • Evennt ID 257 Source Defrag. The file move failed. (0x89000016)

    Hello,
       I have been getting this error every night. I cannot find our much about it online and it does not identify the file.
    this is a virtual windows 2012 server
    Log Name:      Application
    Source:        VSS
    Date:          6/10/2014 11:52:59 PM
    Event ID:      8224
    Task Category: None
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Description:
    The VSS service is shutting down due to idle timeout.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="VSS" />
        <EventID Qualifiers="0">8224</EventID>
        <Level>4</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-06-11T03:52:59.000000000Z" />
        <EventRecordID>1936293</EventRecordID>
        <Channel>Application</Channel>
        <Security />
      </System>
      <EventData>
        <Data>
        </Data>
    Is there something I need too do?
    Thanks

    Hi Tdar,
    Before going further, would you please let me know the complete edition information of this Windows Server
    OS where this issue occurred? Is Windows Server 2012 Standard or any other? And please let me know the complete message of Event ID 257. Meanwhile, would you please let me confirm whether there has SSD on the Windows Server?
    Please refer to the following article and check if can help you.
    Regarding to Event ID 8224, please refer to the following TechNet article and check if can help you.
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu
    Hi 
    I get the same event on all my VMs.  We are using 2012R2 Standard.We are not using SSD.
    Detailed Event
    Log Name:      Application
    Source:        Microsoft-Windows-Defrag
    Date:          29/07/2014 02:46:50
    Event ID:      257
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      xxxxxxxxxx
    Description:
    The volume Recovery was not optimized because an error was encountered: The file move failed. (0x89000016)
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Defrag" />
        <EventID Qualifiers="32768">257</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-07-29T01:46:50.000000000Z" />
        <EventRecordID>2367</EventRecordID>
        <Channel>Application</Channel>
        <Computer>xxxxxxxxxxxxx</Computer>
        <Security />
      </System>
      <EventData>
        <Data>Recovery</Data>
        <Data>The file move failed. (0x89000016)</Data>
        <Binary>00000000A40500005105000000000000629468641336AAB85B55B1B5B038000000000000</Binary>
      </EventData>
    </Event>
     Any suggestions ? 

  • Trouble moving file after rename; can't get the new name, what's missing?

    I know I'm missing a statement to redefine this_item after it has been renamed, but I'm too noobed to know how.
    Files I drop into my layersRenameFolder do get renamed, but then the script fails with error (simplified) "can't get <name of pre-renamed file>"
    So I'm struggling with how to reset the variable so finder knows the new name of the files to move them.
    Note, the code is compilations of other scripts and others corrections. I don't claim to be the original author of any of it. Just trying to piece it together.
    Script follows--------
    on idle
    set PathToDesktop to path to desktop as text
    set layersRenameFolder to (PathToDesktop & "On-Line Proofing1:1 Layout Proofs InDesign:LayoutRenameLAYERS:") as alias
    set outFolder to (PathToDesktop & "On-Line Proofing1:1 Layout Proofs InDesign:Out:") as alias
    tell application "Finder" to set these_items to (every file of layersRenameFolder whose kind contains "PDF")
    --Check to see if there are one or more PDF files in the LayersRename folder on the desktop
    if (count these_items) is greater than 0 then
    tell me to activate
    display dialog "Files located. Script starting!" buttons " " default button 1 giving up after 2
    --Go through all PDF files, one at a time
    repeat with PDFfile in these_items
    --rename PDFFile
    set this_item to contents of PDFfile
    set fileName to name of this_item
    set {TID, text item delimiters} to {text item delimiters, "-"}
    if fileName ends with "1.pdf" or fileName ends with "ALL.pdf" or fileName ends with "CAR.pdf" then set newFileName to (text items 1 thru 2 of fileName) & "1.pdf" as text
    set text item delimiters to TID
    end repeat
    end if
    -- move renamed pdfs to out
    tell application "Finder"
    set name of this_item to newFileName
    move this_item to outFolder with replacing
    end tell
    return 5
    end idle

    When you set the name of a file, the result is just the new name, not a full path. You can rebuild the file path by getting the containing folder and adding the resulting name, for example:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    set theContainer to the container of this_item as text
    set name of this_item to newFileName
    move ((theContainer & the result) as alias) to outFolder with replacing
    end tell
    </pre>

  • QT 7.3 will not allow me to move, rename or delete QT movies

    Hello, I just recently upgraded to Windows XP Service Pack 2 and QuickTime 7.3. I can watch QT movies, but I can't move, rename or delete them. I get a message saying that the file is being used by another program or user. I have shut down all QT programs and used Task manager to shut down anything else that might be using the movie file. I have removed QT from my startup, and set all file associations except for QT movies to other programs. But still the only way I can manage .mov files is to completely uninstall QT 7.3. Please let me know how to fix this.
    Thanks, SDC

    This is awkward. Right... I have used Aperture since it came out.
    In fact, after all these failures, you should try the rebuilding your library first.
    Hold down Option and Command when launching Aperture, though you couldn't back up your files... which was recommended by Apple before you rebuild it.
    It should correct and repair any broken links or permissions. See if it works.
    After, you can simply COPY and not MOVE the library to the external HD. Do you use Firewire? It's much better and reliable. After the library is copied, point Aperture to use the external HD in preference. Close and reopen, it should open the library from the external HD.
    The better bet is to make sure you are using an external HD with Firewire 800. I have some experience with USB2 drives when Aperture crashes a lot. It may seem some kind of bandwidth problem which I couldn't understand. It seems find with small jpg files but if you start importing RAW or do something with the RAW files, USB drives always fail.
    I have moved my library to an external drive since Aperture 2 as my library has grown beyond the internal capacity. My standard practice is now, after working the files, export them in TIFF or JPG, export the 'Project' with the RAW files to DVDs, remove from the library and re-import the JPGs back to keep the library size. Also I keep two faults in separate locations.
    I hope it works.
    J

  • ITunes is locking up during sync of iphone and ipad during backup

    When I try to sync either my iPad or my iPhone 3GS, iTunes is locking up during the backup stage of the sync.  This started two days ago.

    Thanks whatheck, that worked!  I confirm that my antivirus (ESET Smart Security) was interfeering:
    I disabled ESET and synched - it worked!
    Then I also backed it up manually, and that worked also (30 seconds).
    Then I re-enabled Eset and backed up again... it still worked...
    BUT then I Synched again, and it failed!  Had to kill iTunes and the applemobiledeviceservice with taskmgr.
    So I turned off realtime file system protection in Eset, and after restarting iTunes (with 3gs still connected), Itunes said "Verifying PaulW's iPhone" for a couple minutes. 
    - Then it synched fine (couple minutes at most - got a new podcast). 
    - Then I backed up again manually which worked (10 seconds!).
    - Then I synched again, no problem.
    Note that AppleMobileDeviceService.exe is still using 50% cpu when sitting there doing nothing, even with iphone not connected.  Have to kill it manually (in task manager - processes) or cpu fan runs constantly.
    FYI: my ESET is a couple weeks out of date (subscription expired) will have to update it...

  • Error "A web exception has occurred during file upload" when trying to import ESXi image file into Update Manager

    I'm encountering this error and not sure how to fix, I'm quite new to vCenter so please bear with me.
    I'm trying out vCenter 5.1 with Update Manager 5.1 right now.  No license key has been entered and I still have 50 odd days to try it out.
    2 ESXi hosts are being managed by this vCenter, and they're both running ESXi 4.0
    I'm looking to use Update Manager to try to upgrade the ESXi 4.0 hosts to ESXi 5.1
    I downloaded the image file VMware-VIMSetup-all-5.1.0-799735.iso from VMWare website, and is looking to import it using the Update Manager so I can update the ESXi hosts, but I keep on getting the error:
    File name:     VMware-VIMSetup-all-5.1.0-799735.iso
    Failed to transfer data
    Error was: A web exception has occurred during file upload
    I tried importing it by using vSphere client to connect to vCenter server both remotely and locally, with firewall disabled.
    I've read http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1026602
    I've disabled firewall, and there is no anti-virus program on the server.  I've also restarted the machine several times, to no avail, I didn't reinstall update manager because the whole Windows and VCenter installations are clean from scratch.
    I logged into the vSphere Client using Active Directory credentials, and I've made all Domain Admins (which my account is a member of) part of the administrator group on the vCenter server. I can't log in using admin@System-Domain because it tells me I don't have permissions for it, I still haven't really had the chance to figure out why that is and not sure if that makes a difference.
    Also, I'm fairly certain I'm using the right image file, as I've burned some DVD's used that image file to upgrade some other ESXi hosts.  Unless there's a special image file I need to download?
    I'm at lost on what I can do to make it work.  Please advise.
    Thanks.

    The ISO file you mentioned is the one for vCenter Server. What you need is the "VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso" (or VMware-VMvisor-Installer-201210001-838463.x86_64.iso) for the ESXi host.
    André

Maybe you are looking for

  • Is there a way to have an iPad run only 1 app at a time?

    I am a tech support person and teachers are asking me if we can have a students iPad run only one app at a time. For instance, a group of students in biology would be allowed to run only the app for their biology book. Students have gotten so distrac

  • My macbook pro screen page jumps around without touching the touch pad

    When I am on Mail or my Firefox Browser the screen keeps jumping forward, back or to another site without my touching the trackpad. (Macbook Pro 2014.  At first I thought it was the Firefox Browser, but it also happens on "mail" (verizon.com).  This

  • In second stage dealer  po BED,ECES&HECESS value not coming zero

    Dear MM Experts, I am doing second stage dealer process. As per my knowledge in the purchase order the Excise duties should come with zero value but in my case it is calculating automatically. How to maintain this ? Please help me out . Thanks & Rega

  • Dynamic Table Issues

    Hello When I do the following, Insert > Data Objects > Dynamic Data > Dynamic Table I receive this message "While executing insertObject in Dynamic Table.htm, a JavaScript error occured."

  • Using Maven 2.0 with Eclipse

    Hello, Does anyone know of a plugin for eclipse that allows you to create projects based on the maven 2.0 layout? Thanks in advance, Ger