Action Delete File Not Working

I am new to Relevance and Actions Scripting language, so please bear with me. I have search the forum and web but I have not found anything that helps.

I am trying to create an action to delete a file from a directory if the directory is not empty.

I started with the simple action of just deleting a file from a directory. I figured that would be the easy part, but it’s not working.

delete “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__Global__Download_DML\Adobe-Reader\Test.txt”

Error: Command succeeded delete No ‘C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__Global__Download_DML\Adobe-Reader\Test.txt’ exists to delete, no failure reported (action:1915)

I even tried to place the file in a folder on the C: drive with the command: delete “C:\Adobe-Reader\Test.txt”

Still received the same error from before.

Looks like you are missing a few backslash in your file path.

It’s likely that the forum merged the slashes and started italicizing his post.

@psbank

You can run actions with Fixlet Debugger – that will give you more instance response to your commands.

Try running this in the relevance tab of Fixlet debugger:


Make sure that BigFix acknowledges that the file even exists first.
1 Like

Yes when I put it in the forum the slashes got merged. The line is actually this
delete “C:\Program Files (x86)\BigFix Enterprise\BES Client\___BESData\__Global\__Download\_DML\Adobe-Reader\Test.txt”, but it still does not work. (I have doublechecked the paths and this forum is messing with the slashes)

I checked in Debugger and ran the following Relevances, but the results were False

Q:(exists file “Test.txt” of folder “C:\Program Files (x86)\BigFix Enterprise\BES Client\___BESData\__Global\__Download\_DML\Adobe-Reader\Test.txt”)
A: False

Q:(exists file “Test.txt” of folder “C:\Adobe-Reader”)
A: False

Q:(exists file “C:\Program Files (x86)\BigFix Enterprise\BES Client\___BESData\__Global\__Download\_DML\Adobe-Reader\Test.txt”)
A: False

I would think the __Download folder would be clear unless there was an action running relating to it?

Putting this command aside, what is it this action is meant to accomplish? What is the file being deleted to for the grand scheme of the task and are you sure the task itself is creating the file there or that it already exists?

I’ve run into some oddities dealing with “Program Files”, “Program Files (x86)”, “\Windows\System32”, and “\Windows\Syswow64” based on the BES client falling prey to 32-bit redirection. You might try some checks based on the native/redirected path inspectors and see how they turn out. On my system the file listed below actually does exist:

    q: pathname of program files folder
A: C:\Program Files (x86)
T: 0.161 ms
I: singular string

q: pathname of native program files folder
A: C:\Program Files
T: 0.158 ms
I: singular string

q: pathname of program files x32 folder
A: C:\Program Files (x86)
T: 0.170 ms
I: singular string

q: pathname of program files x64 folder
A: C:\Program Files
T: 0.160 ms
I: singular string

q: exists file "C:\Program Files (x86)\PuTTY\Putty.exe"
A: True
T: 0.137 ms
I: singular boolean

q: exists file "PuTTY\Putty.exe" of program files folder
A: True
T: 0.232 ms
I: singular boolean

q: exists file "PuTTY\Putty.exe" of native program files folder
A: False
T: 0.243 ms
I: singular boolean

q: exists file "PuTTY\Putty.exe" of program files x32 folder
A: True
T: 0.239 ms
I: singular boolean

Well I wanted to make sure a folder was cleared out before I downloaded and installed some software.

Thanks Jason I will try that and get back to you.

@JasonWalker I ran the above on my Test PC and got Failed repsonses. I think the Test PC that I am using is having serious issues, so I am going to try it on another PC and see if it works.

You don’t need to delete files from the bigfix download & site folders. It does that automatically between actions.

You should note the end of the message you are mentioning:

no failure reported (action:1915)

This message was improved in later versions, but there was no error in the actionscript its merely telling you that the action didn’t find the file you wanted to delete.

As others have already mentioned, the __Download folder is cleared every time an action starts. In fact if the client CAN’T clear it, another action cannot begin.

1 Like