chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Hide folder with Python filter_list
Author
Message
Hide folder with Python #1
Hi Hi,
i am looking for variants how to hide folders with python..
I've already worked out a solution.

Code:
import shutil
import os
import win32con
import win32api


path1=r"C:\Users\user1\Desktop\5"
path2=r"C:\Users\Administrator\Dokumente\Word"
#path3=r"C:\Windows\System32\Test"


path_exist=os.path.exists(path2)
if path_exist==True:
   print("Ok")
else:
   shutil.copytree(path1,path2)
   print("copy from ", path1)
   print("copy to: ",path2)
win32api.SetFileAttributes(path2,win32con.FILE_ATTRIBUTE_HIDDEN) #Verstekct den Ordner
print("hiden")

Does someone know other possibilities to hiden folders with python?
It is possible to create a folder in the system32 windows folder (see path3  to bypass this error PermissionError: [WinError 5] Access is denied)

I'm sorry for my bad english.

Reply

RE: Hide folder with Python #2
Quote:It is possible to create a folder in the system32 windows folder (see path3 to bypass this error PermissionError: [WinError 5] Access is denied)

The directory Is In use by the OS, hence the permission error.

Boot with a Live CD, navigate to the System32 directory and perform your tasks thereafter.
[Image: AD83g1A.png]

[+] 1 user Likes mothered's post
Reply






Users browsing this thread: 1 Guest(s)