@nodeselect and "go refresh"

So I added a context-menu command to give myself back ownership my directories. With a fresh Windows 7 install on my formatted primary partition, Windows is now only giving me read and execute permissions and nothing else to all my other drives & partitions from my previous WinXP install. Now, while it is normal (and unavoidable in fact) to lose ownership between OS's, this is the first time Windows only gave me back just read&execute permissions and not write permissions. :confused:

Anyway, when I run the following (without the "go refresh"), I need to manually refresh the lister to actually see the ownership update. (I have "Owner" as one of my columns for this exercise.)

@runmode hide @admin takeown /f {filepath$} /r /d y icacls {filepath$} /grant Administrators:F /t go refresh

It's is more of a hopeful wish than an expectation, don't worry, but is there any way of refreshing the lister and still maintain the current file/folder selection? I tried adding @nodeselect, but didn't work.

This works, unless the selected item has wildcard chars in its name. (If there are wildcard chars, ( and ) in particular, then it fails to select the file.)

[quote]@set fn = {file$}
Go REFRESH
Select "{$fn}" MAKEVISIBLE[/quote]

So I guess something like this should work, but I haven't checked:

[quote]@set fn = {file$}
@runmode hide
@admin
takeown /f {filepath$} /r /d y
icacls {filepath$} /grant Administrators:F /t
Go REFRESH
Select "{$fn}" MAKEVISIBLE[/quote]

Works like a charm. Thanks!

As a follow-up, since you know everything there possibly is to know about DOpus' capabilities ( :slight_smile: ), I was wondering if there is some clever way to implement some sort of feedback in the above script.

Specifically, is there a way to update DOpus's Output window (maybe the Log tab) with the current file or folder the script is running on. When multiple files or folders are selected, the script to run independently on each one until they are all processed. For each pass, I would like to update the Log window with the current "active" file/folder so I can have some sort of sense of the progress of the operation as a whole.

I have thousands of files and folders to process, and it is taking 5 to 10 minutes to process any given base directory, and as of right now, I have nothing other than my CPU Usage meter to indicate that it's actually doing something. :slight_smile:

Actually, it didn't take as long as I anticipated as now I'm done, but I would still like to know for future reference if it is possible to update the Output window like I described above.

If you want to track progress just remove the @runmode hide so you can see the output of the takeown and icacls commands. :slight_smile:

You could pipe their output into a text file and view that instead, I guess, but it seems like you're hiding the stuff you want to see, so just don't hide it and you can see it. Or have I missed something?

I understand why you would think that, but actually, before I had the "hide" command, all I would get was an instant flash of the cmd window regardless of how long the operation took, i.e., it opened but immediately closed. As I found that annoying and distracting, I just decided to hide it altogether.

In fact, I even initially using a DOS pause command (not supported in Vista/Win7 apparently as I got a "command not recognized) so I could see the commands while I was testing out the script. In the end, I just had to rely on trial and error until I got the script right. :frowning:

Ah, in that case edit the command and change the Function Type drop-down to MS-DOS. Then it'll be run as a batch file and you'll see the output.

You can put a pause command at the end then, too.

That would explain it. :sunglasses:

But now back to my actual question. Is it possible to update the Output window in a script via some internal command: yes or no?

Only via VBScript (etc.), which is only supported in Rename Scripts.

You can abuse Rename Scripts to do things other than (or as well as) renaming things, though. See here.