I am facing this problem of errno13 permission denied. I wrote a script that is creating a .txt file and writing into.
f = open("something.txt","w")
f.write("something")
f.close()
Then, i added the script on registry startup
hkey = win32api.RegCreateKey(win32con.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run")
win32api.RegSetValueEx(hkey, 'Test', 0, win32con.REG_SZ,("C:\\Users\\Username\\Desktop\\script.py"))
win32api.RegCloseKey(hkey)
When i run the script, is working very good, but, when i restart my computer and the script runs, it shows me an error : [Errno13] Permission denied!
From other similar questions that i have read , it's because i do not have administrator privileges ?!
Is it Python's bug ? My code is wrong ? Is it possible the script run with administrator privileges ?
Sorry, i am confused, but i want to understand what is going on!
I am using Python 3.5.3 , Windows 10
Thanks !