Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
How to remove old files from directory (Selected by date)

VAR string stFileName;
VAR iodev logfile;
Write logfile,stTimeLogs;
Close logfile;
http://www.luxrobotic.com
Answers
-
Is there a possibility of writing your files to an external device?
It has been observed writing to a Windows PC and running a batch file, or PowerShell script, against the folder with the files has worked.Post edited by SomeTekk on0 -
Hi SomeTekk,I have to try.I'll keep you inform, but I can't do it quickly.ThanksRegardsCornet RaymondManager+352 621 354 570raymond.cornet@luxrobotic.com
http://www.luxrobotic.comHP ZBook Fury 16 G110 -
I am a bit fuzzy on exactly what options are necessary.
The RAPID REFERENCE Manual was a great tool used to get the results I needed exported to an external destinaton.
Here's an AI generated PowerShell script deleting old files and folders:# Set parameters
$targetDir = "C:\Path\To\Your\Directory"
$daysOld = 30
# Calculate cutoff date
$cutoffDate = (Get-Date).AddDays(-$daysOld)
# Delete files older than the cutoff date
Get-ChildItem -Path $targetDir -Recurse -File | Where-Object {
$_.LastWriteTime -lt $cutoffDate
} | ForEach-Object {
try {
Remove-Item $_.FullName -Force
Write-Host "Deleted file: $($_.FullName)"
} catch {
Write-Host "Failed to delete file: $($_.FullName) - $_"
}
}
# Delete empty directories
Get-ChildItem -Path $targetDir -Recurse -Directory | Sort-Object -Property FullName -Descending | ForEach-Object {
if (-not (Get-ChildItem $_.FullName -Recurse)) {
try {
Remove-Item $_.FullName -Force
Write-Host "Deleted empty directory: $($_.FullName)"
} catch {
Write-Host "Failed to delete directory: $($_.FullName) - $_"
}
}
}
Best of luck!0
Categories
- All Categories
- 5.7K RobotStudio
- 402 UpFeed
- 21 Tutorials
- 16 RobotApps
- 307 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 368 IRC5
- 92 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 859 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings
