The problem is that the output redirect does not get sent to the source directory but some other folder instead (i can't remember if it was the Windows\System32 or my $HOME directory).
So I've come up with the following work-around. It runs the commands in a non-UNC folder then copies the output files back to the UNC path.
I am not entirely satisfied with this solution. Does anyone have a better one? I am new to DOpus scripting so I may be doing something wrong. I hope so because I am a little dismayed that I having problems with my first DOpus script.
You don't need to use @runonce: for any of the lines in your script, by the way. That is only needed for lines which would be run per-file to force them to only run on the first file. If a line doesn't use any file paths, or uses all file paths at once, then it will only ever be run once.
Thanks Leo, that's a better solution. I assumed there was going to be a UNC limitation on the redirect, but it's only on the current working directory.
I don't think it is very good to have inconsistant behavior depending upon the type of paths you are browsing. Ideally Directory Opus scripts should run the same way on any type of folder.
For some reason my Copy command was trying to copy all files from the source folder to the source folder unless I added the @runonce. Looking at the documentation I can only assume this is the proper usage of the control code.
Did you read the page I linked? It's a Windows problem, not an Opus problem. What you're asking for would require Opus to either temporarily map a drive letter for commands (which would cause all kinds of problems with many programs) or to replace Windows itself.
Sorry, you're right, that copy line works fine without @runonce. I can't recall what I did to cause that original problem.
I did read the blog entry. It's actually not a Windows problem, but a problem with the standard command interpreter (CMD.exe). Opus is not forced to use it as their command shell.
Anyway, my main issue is with the scripts being fragile: it works for one folder but not another.
If you don't want Opus to use cmd.exe then don't tell it to make a DOS batch button.
[/quote]
Fair enough, I'd rather not use DOS batch scripts if possible.
Can I run a command line tool as an external program and redirect the output? I think without redirection and pipe support that CMD offers the scripts are rather limited.
That depends on the command and whether it lets you specify an output file or always writes to stdout and expects something else to capture/redirect its output.