# Enqueued all command sent via dopusrt

**URL:** https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084
**Category:** Help & Support
**Created:** [August 29, 2022, 2:34pm UTC](https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084 "2022-08-29T14:34:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![oevesque](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/71c47a/32.png) [@oevesque](https://resource.dopus.com/u/oevesque)
#### Post date: [August 29, 2022, 2:34pm UTC](https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084/1 "2022-08-29T14:34:13Z")

</div>

Hi,  
I've made a python script who create and launch Dopus command.  
It's a succession of rename command and move command.  
My problem is that Move command are queued, but not rename command who are executed immediatly.  
Is there any option to tell dopusrt to queue sent command ?

my project:

I have this folder with unsorted structured file

```auto
> Unsorted files
> Video 15, sequence 02.mp4
> Video 15, sequence 03.mp4
> Video 15, sequence 05.mp4
> Video 15, sequence 08.mp4
> Video 16, sequence 01.mp4
> Video 17, sequence 13.mp4

```

and a folder ordered like this:

```auto
> Video 02, seq 01 & 03 & 08
> Video 02, sequence 01.mp4
> Video 02, sequence 02.mp4
> Video 02, sequence 08.mp4
> Video 15, seq 01
> Video 15, sequence 01.mp4
> Video 17, seq 01 & 12 & 32
> Video 17, sequence 01.mp4
> Video 17, sequence 12.mp4
> Video 17, sequence 32.mp4

```

etc. etc...

My script read each file name , look if the folder exist, rename to add the new sequence and move the file to the rename folder.

For this my python script create command (the path are simplified for this example) like this  
if I want to add Video 17, sequence 13.MP4  
dopussrt.exe /cmd RENAME "Video 17, seq 01 & 12 & 32" TO "Video 17, seq 01 & 12 & 13 & 32"  
and then  
dopusrt.exe /cmd COPY MOVE COPYATTR=yes TO "Video 17, seq 01 & 12 & 32" "Destinationparth\Video 17, sequence 13.mp4" AS "Video 17, sequence 13.mp4"  
It's working very fine.

My probleme is with the 4 "video 15" sequence.  
Video 15, sequence 02.mp4  
Video 15, sequence 03.mp4  
Video 15, sequence 05.mp4  
Video 15, sequence 08.mp4

1. the folder "Video 15, sequence 01" is renamed "Video 15, sequence 01 & 02"  
the file "Video 15, sequence 02.mp4" is moved to the folder "Video 15, sequence 01 & 02". the copy starts.
2. My programs continue to the next file and:  
the folder "Video 15, sequence 01 & 02" is renamed immmediatly to "Video 15, sequence 01 & 02 & 03"  
the "file Video 15, sequence 03.mp4" is moved to "Video 15, sequence 01 & 02 & 03"  
BUT, because the number 02 is still moving, the command is enqueued!
3. the folder "Video 15, sequence 01 & 02" is renamed immediatly to "Video 15, sequence 01 & 02 & 03 & 05"  
the file "Video 15, sequence 05.mp4" is moved to "Video 15, sequence 01 & 02 & 03 & T05" (this commmand is enqueud too)

And now the problem: file 2 has finished moving and File 3 is starting, but in a folder that doesn't exist anymore.  
I would not have this problem if I could enqueud all rename commands.

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [August 29, 2022, 2:48pm UTC](https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084/2 "2022-08-29T14:48:30Z")

</div>

Commands run via DOpusRT.exe /cmd and /acmd are asynchronous. It's not really meant for the type of thing you're doing.

If you want Opus to do the operations (rather than the script itself move/rename things), I would make the script inside of Opus (using JScript or VBScript and Opus's [scripting API](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting.htm)). Then you can use the [Command object](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Command.htm) to run things synchronously. Since it's going to depend on Opus in either case, doing it that way around should make things a lot easier.

Alternatively, you can also rename things as part of the copy/move operation.

---

<div class="post-metadata">

### Author: ![oevesque](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/71c47a/32.png) [@oevesque](https://resource.dopus.com/u/oevesque)
#### Post date: [August 29, 2022, 2:50pm UTC](https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084/3 "2022-08-29T14:50:50Z")

</div>

Thanks.  
But I know python and not JScript or VBscript.  
I guess I will change my code to only use internal python command (but Dopus GUI is way more beautiful..)

(but I will first check the rename in copy/move option)

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [August 30, 2022, 12:59pm UTC](https://resource.dopus.com/t/enqueued-all-command-sent-via-dopusrt/42084/4 "2022-08-30T12:59:21Z")

</div>

> [@oevesque](#):
>
> But I know python and not JScript or VBscript.

Once you know one, it's trivial to switch to another.
