path = itsm.getParameter('Folder_Path')#give the folder path which you want to view or hide (E.g) C:\Users\User1\Documents or You can specify your drive (E.g) C:
Enable_Option = itsm.getParameter('Hide_or_View')#give "Hide" to hide the folder or "View" to view the hidden folder and files.


import os
import subprocess
import ctypes


class disable_file_system_redirection:
    _disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
    _revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
    def __enter__(self):
        self.old_value = ctypes.c_long()
        self.success = self._disable(ctypes.byref(self.old_value))
    def __exit__(self, type, value, traceback):
        if self.success:
            self._revert(self.old_value)
with disable_file_system_redirection():
	def ecmd(path,Enable_Option):
		option = (Enable_Option.capitalize()).strip()
		enable_command = "attrib -h -r -s /s /d "+path+"\\*.*"
		disable_command = "attrib +h +r +s /s /d "+path+"\\*.*"
		if option == "View" :
			cmd = subprocess.Popen(enable_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
			res,err = cmd.communicate()
			if err:
				print(err)
			else:
				print(path+" "+"Files are Enabled")
		else:
			cmd = subprocess.Popen(disable_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
			res,err = cmd.communicate()
			if err:
				print(err)
			else:
				print(path+" "+"Files are Disabled")

ecmd(path,Enable_Option)