| AylinCE Grandmaster Cheater Supreme
 
  Reputation: 37 
 Joined: 16 Feb 2017
 Posts: 1528
 
 
 | 
			
				|  Posted: Tue May 27, 2025 3:16 pm    Post subject: |   |  
				| 
 |  
				| Try this 3-angle code to have the code recognize and read the current state of the file: 
 
  	  | Code: |  	  | local form = getMainForm() path = createOpenDialog(form)
 if path.Execute() then
 local pathutf28 = utf8ToAnsi(path.Filename)
 local pathutf38 = utf8ToAnsi(ansiToUtf8(path.Filename))
 local pathutf48 = ansiToUtf8(path.Filename)
 
 sleep(200)
 if pathutf28 then
 print(28, pathutf28)
 print(28, io.popen([[powershell -Command "Get-Item ']] .. pathutf28 .. [['"]]):read("*a"))
 local file = io.open(pathutf28, "r")
 if file then
 print(28,"File exists, closing it...")
 file:close()
 else
 print(28,"File not found! The path may be incorrect.")
 end
 end
 print("------------------------------>>>")
 print("------------------------------>>>")
 if pathutf38 then
 print(38, pathutf38)
 print(38, io.popen([[powershell -Command "Get-Item ']] .. pathutf38 .. [['"]]):read("*a"))
 local file = io.open(pathutf38, "r")
 if file then
 print(38, "File exists, closing it...")
 file:close()
 else
 print(38, "File not found! The path may be incorrect.")
 end
 end
 print("------------------------------>>>")
 print("------------------------------>>>")
 if pathutf48 then
 print(48, pathutf48)
 print(48, io.popen([[powershell -Command "Get-Item ']] .. pathutf48 .. [['"]]):read("*a"))
 local file = io.open(pathutf48, "r")
 if file then
 print(48, "File exists, closing it...")
 file:close()
 else
 print(48, "File not found! The path may be incorrect.")
 end
 end
 end
 
 path.Destroy()
 | 
 
 Assuming "28" gives the correct result, the file deletion method could be:
 
 
  	  | Code: |  	  | local form = getMainForm() path = createOpenDialog(form)
 if path.Execute() then
 local path_correct = utf8ToAnsi(path.Filename)
 os.remove(path_correct)
 end
 path.Destroy()
 | 
 _________________
 
 |  |