I have made a custom menu to run scripts when clicking an empty area in a folder (i.e. not on a file). However in DOpus the scripts are failing because the current directory is set to C:\Windows\System32, regardless of the current location, whereas in Windows Explorer the current directory is set to the actual directory that the UI is displaying.
That's intentional, for improved security. It avoids DLL planting exploits if you run a program which doesn't take steps to avoid loading DLLs from the current directory (which might be files downloaded from the internet).
You can change it to work like File Explorer via Preferences / Miscellaneous / Advanced: [Compatibility] def_func_cd_sourcedir, but it'd be much better to make your menu item independent of the current directory.
Using the current directory doesn't really make sense anyway, as there can be situations where a menu is run on files from multiple locations. Since you're passed the full path to each file, you don't need to use the current directory in most cases.
Hi Leo,
I'm not running the script on a file, but on the empty background of a folder. The script essentially copies files from a central location to the directory of its first argument. If no argument is supplied then it assumes the working dir is the argument. I don't know of any other way to get a right click menu to function in the way intended that works for both DOpus and Explorer users.