Can SilkTest set the READ-ONLY attribute on a Windows file?
The best way to perform a READ-ONLY attribute change on a file in the windows file system is to use the "SYS_EXECUTE" and the windows "attrib" command. The SYS_EXECUTE function executes a specified command which it takes as a STRING parameter.
Example of use:
SYS_EXECUTE ("attrib +R c:\private\private.txt")
Would execute the command to make the "private.txt" file in the private directory read-only.
SYS_EXECUTE ("attrib -R +H c:\private\private.txt")
Would execute a command that will clear the read-only attribute and set the hidden attribute.
NOTE: SYS_EXECUTE is not available under the Windows 95 Operating System.
Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path] filename]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes matching files in the current directory
and all subdirectories.