I am trying to delete a set of txt files located in a certain directory by writing a cmd file (removeFiles.cmd). The cmd file gets all the txt files to be deleted in a directory leaving the most recent file alone using now - modification time of it statement but the i get exit code 1.
When i go to run the created cmd file in a command window on it’s own i get the error “the system cannot find the file Specified” and the directory and files are verified to be there.
This is the action script that is being executed
action uses wow64 redirection false
delete __appendfile
appendfile {concatenation “%0d%0a” of (“del /q %22” & it & “%22”) of pathnames of find files ("*.txt") whose (now - modification time of it > 1 * day) of (it; descendant folders of it) of folders (“C:\ProgramData\Qualcomm® Snapdragon™ X55 5G Modem\SVCLog”)}
delete RemoveFiles.cmd
move __appendfile RemoveFiles.cmd
waithidden cmd /c RemoveFiles.cmd
The cmd file looks like this once it’s has been created
del /q "C:\ProgramData\Qualcomm® Snapdragon™ X55 5G Modem\SVCLog\Test.txt"
del /q “C:\ProgramData\Qualcomm® Snapdragon™ X55 5G Modem\SVCLog\Test1.txt”
This is the output from running RemoveFiles.cmd in a command window
C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__FixletDebugger>del /q "C:\ProgramData\Qualcomm« SnapdragonÖ X55 5G Modem\SVCLog\Test.txt"
The system cannot find the path specified.
C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__FixletDebugger>del /q "C:\ProgramData\Qualcomm« SnapdragonÖ X55 5G Modem\SVCLog\Test1.txt"
The system cannot find the path specified.
Any help would be greatly appreciated, Thanks