Jump to content

Recommended Posts

Posted

Hello again,

I am having trouble deleteting some simple log files.

Here is my very basic script:

; Remove read-only attribute
FileSetAttrib(@LocalAppDataDir & "\Razer\RazerAppEngine\User Data\Logs\*.log", "-R")

; Delete all log files
FileDelete (@LocalAppDataDir & "\Razer\RazerAppEngine\User Data\Logs\*.log")

Four of the log files are in use, so I don't expect those files to be deleted. Of the other log files, some are deleted and some are not.

I have tried adding '#RequireAdmin', but make no difference.

I can delete the files manually in explorer without issue (except for the 4 locked files).

Any thoughs?

Posted (edited)

Hi Nine,

Just tried FileRecycle, same effect.

All files have normal attributes. I added FileSetAttrib just in case.

I also added this line to the begining of the script, as a test:

FileOpen(@LocalAppDataDir & "\Razer\RazerAppEngine\User Data\Logs\TEST.log", 1)

Even the created TEST.log file is not being deleted.

I have checked file and folder permissions, full access all round.

 

I also just made a quick batch file to compare:

@echo off

DEL /Q "C:\Users\%username%\AppData\Local\Razer\RazerAppEngine\User Data\Logs\*.log" 1>NUL 2>&1

The batch file works perfectly.

Edited by TwoCanoe
More info
  • Solution
Posted

Try gathering all logs file into an Array with _FileListToArray, then delete files individually.  I don't know how FileDelete works.  Maybe it is stopping on the first issue (locked file).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...