Command script button not working on USB instance

I have a button on the DO toolbar that executes a 'Script Function' to move the last file downloaded to my Downloads folder to whatever folder is active in my lister. The script is one you gave me here:

The button works fine on my installed DO. I have the same button on a USB drive licensed DO that I use on a work laptop. The button doesn't work there. The only difference in the script is that I edited the path on the USB DO to match the download folder path on the laptop, which is different than the installed DO. How to troubleshoot?

Also, just for my understanding, why can I locate that script by typing the keyboard shortcut on the Keys tab of the Customize Toolbar interface, but I don't see it listed in the User-defined Commands section of the Commands tab of that same interface?

Is there any error message or does nothing happen at all?

Can you show us the edited lines? It might just be something wrong there. For example, \ characters in JScript strings need to be doubled, i.e. \\, which often messes up Windows paths if they're pasted into the code.

It should be under Script Commands in the same list.

User-Defined Commands are similar to Script Commands, in that they can define a command which other things can run, but also different in that they don't use scripting and are more simple / less powerful.

If you're familiar with the button editor, the distinction is similar to "Standard Function" vs "Script Function" there.

When I click the button, nothing happens, no error message. The script is:

function OnClick(clickData)
 {
    var cmd = clickData.func.command;
	cmd.deselect = false;
	cmd.ClearFiles();

	var newest = null;
	var folderEnum = DOpus.FSUtil.ReadDir("C:\Users\username\Dropbox\download folder", false);

	while (!folderEnum.complete)
	{
		var item = folderEnum.next;
		if (!item.is_dir && item.name != "desktop.ini")
		{
			if (newest == null || newest.modify.Compare(item.modify) < 0)
			{
				newest = item;
			}
		}
	}

if (newest != null && DOpus.Create.Date() - newest.modify < 10 * 60 * 1000)
	{
		// "Copy HERE" doesn't work with scripting; use SetDestTab instead.
		cmd.SetDestTab(cmd.sourcetab);
		cmd.RunCommand('Copy MOVE FILE="' + newest + '"');
	}
}

Strangley, I don't see the script under Script Commands, and it doesn't show when I search for it. In the Command Editor, the script label is "Move last download here", but a search for "move" in the interface search doesn't show it. Is the name of the script not the same as the label?

var folderEnum = DOpus.FSUtil.ReadDir("C:\Users\username\Dropbox\download folder", false);

The backslashes in that path need to be doubled (see previous reply for why). That's likely all that needs fixing if the rest of the script is unchanged.

It's just a normal button that contains its own script. It isn't a Script Add-In and doesn't add a Script Command that could be used in multiple buttons/hotkeys/etc.