How to change file attribute to hide

This button Do.

  1. create a desktop.ini file with the selected icon name.

I want to hide the selected icon file & the desktop.ini file also. Is that possible. I am in Directory opus 11. Thanks.

Clipboard EXPANDNEWLINES SET [.ShellClassInfo]\nIconResource={file},0
Clipboard PASTE PREFERTEXT 
Rename "Clipboard Text.txt" TO "desktop.ini"
 
SetAttr FILE={sourcepath} SETATTR=r

You're already setting the R(ead-only) attribute. You could set the H(idden) and S(ystem) attributes in the same way.

desktop.ini files usually just had the H and S (and sometimes A) attributes set, and not R, for what it's worth.

If you want to avoid trashing your clipboard contents each time the button is used, you could use scripting to create the file instead of doing it via the clipboard.