I am not particularly familiar with Windows permissions, but I had assumed that elevated permissions were equivalent to sudo. However, I came across this "unexpected" behavior when running a simple python program via cmd.exe and powershell, which leads me to believe that it's not so clear-cut:
When the target directory has 755 permissions (the default), I cannot write to the directory if I'm running cmd.exe/powershell with elevated permissions. I can write to the directory if I'm not running elevated. If I change the directory permissions to 766, I can write to it with either elevated/regular permissions.
Using windows cli (cmd.exe or powershell):
echo "asdf" > testdir\testfile.txt
And a minimal example in python:
import os def main(): fname = os.path.join(os.path.dirname(os.path.realpath(__file__)), "testdir", "testfile.txt") f = open(fname, "w") f.write("asdf") f.close() if __name__ == "__main__": main()
So, what group does the elevated user belong to? And why does the elevated user not have permissions to directories that they created as a "non-elevated" user?