# Sending multiple commands with 'dopusrt.exe /cmd'

**URL:** <https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193>\
**Category:** Help & Support\
**Created:** [December 20, 2008, 1:27am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193 "2008-12-20T01:27:14Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee321987](https://resource.dopus.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@lee321987](https://resource.dopus.com/u/lee321987)\
**Post date:** [December 20, 2008, 1:27am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/1 "2008-12-20T01:27:14Z")

</div>

I have a button which asks for confirmation before loading my main layout

`@confirm Load Layout "Main"?
Prefs LAYOUT Main`  
What I want to do is create a batch file that does this. Is it possible to include more than one command on a single call to 'dopusrt.exe'?  
e.g.

```auto
dopusrt.exe /cmd @confirm Load Layout "Main"?; Prefs LAYOUT Main
```

Thanks in advance.

---

<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:** [December 20, 2008, 1:52am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/2 "2008-12-20T01:52:15Z")

</div>

You can't use @ modifiers with dopusrt directly.

Instead, create a User Command (Customize -\> Commands, User category) and then run that via dopusrt.

In general, you can run multiple commands via dopusrt by running dopusrt multiple times, once per command. But since you cannot run the @ modifiers from dopusrt directly that won't help here. (Even if you could it wouldn't be useful: The @confirm would cancel the first dopusrt command (which was just the @confirm itself) and then your batch file or whatever would run another command via dopusrt, independently of the @confirm.)

---

<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:** [December 20, 2008, 1:53am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/3 "2008-12-20T01:53:29Z")

</div>

Alternatively, create a button normally, then drag it to your desktop. That will create a .dcf file which you can double-click to run the button.

You can also launch .dcf files from batch scripts using the "start" command.

---

<div class="post-metadata">

**Author:** ![lee321987](https://resource.dopus.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@lee321987](https://resource.dopus.com/u/lee321987)\
**Post date:** [December 20, 2008, 2:46am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/4 "2008-12-20T02:46:39Z")

</div>

Thanks a lot -- very useful. My only question is -- you said:

> [@](#):
>
> create a User Command (Customize -\> Commands, User category) and then run that via dopusrt.

How do I run it? I tried this:

```auto
dopusrt.exe /cmd <my User Command name>
```

---

<div class="post-metadata">

**Author:** ![tbone](https://resource.dopus.com/user_avatar/resource.dopus.com/tbone/32/25726_2.png) [@tbone](https://resource.dopus.com/u/tbone)\
**Post date:** [December 20, 2008, 11:14am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/5 "2008-12-20T11:14:41Z")

</div>

I once created a little utility which can be run from dos and shows you  
a custom requester with one or up to 10 buttons to choose from.

Like "c:RequestChoice" in old amiga days.. if that is of any help, i'd  
put it up here somewhere.

Regards,  
Rob.

---

<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:** [December 20, 2008, 11:15pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/6 "2008-12-20T23:15:49Z")

</div>

[quote="lee321987"]How do I run it? I tried this:

```auto
dopusrt.exe /cmd <my User Command name>
```

That's correct.

Unless you've added the Opus directory to your system path you will need to use the full path to dopusrt.exe, in quotes since there's a space in the path.

---

<div class="post-metadata">

**Author:** ![lee321987](https://resource.dopus.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@lee321987](https://resource.dopus.com/u/lee321987)\
**Post date:** [December 21, 2008, 1:39am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/7 "2008-12-21T01:39:49Z")

</div>

> [@leo](#):
>
> you will need to use the full path to dopusrt.exe, in quotes since there's a space in the path.

I know (but thank you). I ran it from DOpus's root dir.  
I think I figured it out -- it works, but not with buttons that utilize the currently selected files (or current directory). Well, it still works, but does not send the arguments. Right?

---

<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:** [December 21, 2008, 8:33am UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/8 "2008-12-21T08:33:34Z")

</div>

Arguments like {file} are expanded by Opus before it runs commands, whether they are internal or external. The commands themselves do not know anything about {file} and similar codes.

So if you are running a command via dopusrt.exe from outside of Opus then whatever you are running the command with needs to supply the file names and won't understand Opus-specific codes like {file}.

Commands which naturally use the selected files, without them being passed as arguments, will still work on the selected files even when run externally. For example, if you run dopusrt.exe /cmd Copy then it will copy the selected files in the active window to the destination window.

---

<div class="post-metadata">

**Author:** ![darled](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@darled](https://resource.dopus.com/u/darled)\
**Post date:** [February 6, 2026, 4:45pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/9 "2026-02-06T16:45:59Z")

</div>

> [@Leo](#):
>
> ```auto
> dopusrt.exe /cmd <my User Command name>
> 
> ```

Hello peeps. I have a user command defined (js script) . The template is defined as TEXT/K . But when I call it from a py script, nothing happens. It is a simple script - to show a passed arg in the DOPUS SCRIPT LOG WINDOW

```auto
	DOPUS_cmd = f"{DOPUSRT} /cmd LogToScriptOutput dest_folder_s:\n{dest_FOLDER}"

```

BTW - the **{DOPUSRT}** part works fine. i use it in a prev line to do a copy move.

Any ideas ? Thx

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [February 6, 2026, 4:53pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/10 "2026-02-06T16:53:34Z")

</div>

try with `/acmd` instead.

> **[DOpusRT Reference \[Directory Opus Manual\]](https://docs.dopus.com/doku.php?id=reference:dopusrt_reference)**

Also, you could add some logs to your user command to see if it is at least running and what command line it receives.

Also, and I'm not 100% sure, but if your arg is defined as /K, you need to include it in the command line. You can try NOT setting any type so the arg is implied.

---

<div class="post-metadata">

**Author:** ![darled](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@darled](https://resource.dopus.com/u/darled)\
**Post date:** [February 6, 2026, 5:00pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/11 "2026-02-06T17:00:08Z")

</div>

thx for prompt response. awesome. I tried /acmd already nothing. Will try your suggestion:

> [@errante](#):
>
> Also, and I'm not 100% sure, but if your arg is defined as /K, you need to include it in the command line. You can try NOT setting any type so the arg is implied.

---

<div class="post-metadata">

**Author:** ![darled](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@darled](https://resource.dopus.com/u/darled)\
**Post date:** [February 6, 2026, 5:09pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/12 "2026-02-06T17:09:27Z")

</div>

tried using

```auto
	DOPUS_cmd = f"{DOPUSRT} /cmd LogToScriptOutput TEXT=dest_folder_s:\n{dest_FOLDER}"

```

where: _ **TEXT/K** _ is the template for the user function. No joy.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [February 6, 2026, 5:18pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/13 "2026-02-06T17:18:15Z")

</div>

This one works for me.

 ![image](https://resource.dopus.com/uploads/default/original/3X/5/5/55b4860d304d815c282264369cb0b45bcbda61ce.png)

Then use something like: `Logger TEXT=some text`

Where the text is passed as raw.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [February 6, 2026, 5:28pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/14 "2026-02-06T17:28:23Z")

</div>

Also works if I set `TEXT` with no type defined.

and then use something like:

```python
import subprocess

dopusrt = r"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe"
dest = r"D:\my folder"

args = [dopusrt, "/acmd", "Logger", f"TEXT={dest}"]

try:
    subprocess.run(args, check=True)
except Exception as e:
    print(f"Error: {e}")

```

---

<div class="post-metadata">

**Author:** ![darled](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@darled](https://resource.dopus.com/u/darled)\
**Post date:** [February 6, 2026, 5:46pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/15 "2026-02-06T17:46:32Z")

</div>

> [@errante](#):
>
> `subprocess.run(args, check=True`

YOU ARE A ⭐

Will try it on my end

---

<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:** [February 6, 2026, 5:50pm UTC](https://resource.dopus.com/t/sending-multiple-commands-with-dopusrt-exe-cmd/7193/16 "2026-02-06T17:50:57Z")

</div>

Looks like you're including a newline `\n` in the command line arguments. I'm not sure if that will work or not. (Even if it does, it may be fragile, as the various layers in the language, then operating system, then command itself, may interpret it as two command lines, not one.)
