The example script below demonstrates how SetReadOnly can be called from within an ITP/Server script.
# ITP/Server script SetReadOnly
Parameter Text File;
Parameter Boolean ReadOnly;
Parameter Text LogFile;
Const Text pathtovbs = "C:\Program files\ITP Server\Tools\SetReadOnly.vbs";
# The declaration above is one line!
Var Text readonlychar = "N";
If (ReadOnly) Then
readonlychar = "Y";
Fi;
RunCommand
CmdLine("WScript.exe //B //nologo " +
"""" + pathtovbs + """ " +
"""" + File + """ " +
"""" + readonlychar + """ " +
"""" + LogFile + """");
# Please note that all quotes in CMDLine are needed. (quotes are
# used to escape quotes)