none
Move files that are being executed from batch RRS feed

  • Question

  • Hi,

    First of all, it's my first time around here and I'm not sure where should I post my question, so forgive me if this is not the place.

    This is the actual situation: I have some tasks running more or less constantly that are in a live environment, while I develop in a dev environment. When I want to launch updates to live, what I usually do is "Drag and drop" the current files in the live environment to a backup folder. This way, the tasks keep being executed in the new backup folder. At this point, I would copy the new files to the live folder. Therefore, the next time the tasks run they will be updated.

    But it turns out to be kind of annoying each time I want to have new things, so I wanted to have a little batch script that did all of this automatically. The thing is that it seems impossible to do the "Drag and drop" function from batch.

    I have tried using the usual "move" function, creating some symbolic links, using other copying tools such as Robocopy. But none of them have had success due to my tasks being executed all the time.

    Is there a way around this problem? Thank you very much!


    • Moved by Bill_Stewart Wednesday, May 30, 2018 8:51 PM Unanswerable drive-by question
    Thursday, April 12, 2018 11:34 AM

All replies

  • The batch command for "move" is "move".

    move /?

    If your tasks are moving the files then they can cause the batch to fail due to conflicts. You need to spend time designing a safe way to move files.


    \_(ツ)_/

    Thursday, April 12, 2018 11:41 AM
  • The move command doesn't work when files are being executed.

    Definitely, I need to find out a way to move the files safely, but I have no idea how to even start. I guess my question is related to this.

    Thursday, April 12, 2018 11:43 AM
  • There is no way to move an executable that is being used.

    \_(ツ)_/

    Thursday, April 12, 2018 11:44 AM
  • But I CAN move it from the interface by dragging and dropping. I mean, select all the files that are being used (dlls, exe, ...) and drag them to another folder.

    It is quite weird that a batch script can't do it.

    • Edited by MarcosRodMun Thursday, April 12, 2018 11:48 AM clarify
    Thursday, April 12, 2018 11:46 AM
  • You have other issues that you will have to troubleshoot.

    Start by not using batch and use PowerShell.  It will give you better diagnostics.


    \_(ツ)_/

    Thursday, April 12, 2018 12:24 PM