Trouble running rmempty.exe in script

I want to run rmempty.exe after moving a bunch of files and folders.

I tried this.

cmd.Runcommand("@sync:'C:\\Program Files\\GPSoftware\\Directory Opus\\RMEMPTY.EXE' '{sourcepath}'");

I get the following error.

run

I assume I am making a typo...

edit: i think the site removed the required escape slashes. they are in the actual code though.

Your ' and " quotes are the wrong way around. (JavaScript strings can use either, but Opus and Windows commands must use " quotes.)

(RMEMPTY.EXE is not normally in that location either, as it's not part of Opus, but I assume you have copied it into that place.)

I found instructions somewhere on here to put the exe there.

Click the "Editing & Formatting Tips" link above the post editor when typing a post for instructions on how to post code blocks and so on.

Those instructions are bad. :slight_smile: Random executables should not be placed there.

Here is the forum thread. Delete all empty folders? - #3 by MtDew12oz If you want to see what was said

That thread is ancient. If you want to delete empty folders, you probably don't need external commands for that. Not sure what you're actually trying to do, though.

Sorry I just reread the instructions and it has it in the bin folder. Is that okay? or should I just completely pull it out?

In the case of this script I want to clean up all the empty folders after my script moves eveything elsewhere.

Also, I have a button that I use to delete all the empty folders or folder containing empty folders with the press of a button.

The script can do that itself without requiring an external exe.

  • The Opus Delete command has a FAILNOTEMPTY argument which lets you tell it to delete something you think is empty while it will do nothing if it turns out that isn't the case. (Must be combined with NORECYCLE).

  • Scripts can enumerate folder content to find all folders or all empty folders, or whatever is needed. An example that lists everything under C:\ is included in the button editor's default example script.

But if you do want to use rmempty.exe instead, and you want to make it part of your Opus config, then in or below /dopusdata/User Data is the correct place to put your own files that will be included in config backups. (Paste the path into the location bar and push return to locate the appropriate directory for your system/username/etc.)

2 Likes