Change the Windows folder permissions to Read only from Python

632 views Asked by At

I have a test case to automate, where in I need to change the folder's permission to read only from Python script. I am using Test Complete tool with python scripting for automating the manual tests.

I am not able to accomplish the tasks, I tried Googling but no luck.

1

There are 1 answers

1
Jasper Nichol M Fabella On

you can try this line of code.

import os, stat

os.chmod(ur"file_path_name", stat.S_IREAD)