if there is nothing to move then I want zero output, i.e. don't spam the out it runs…
- User
if there is nothing to move then I want zero output, i.e. don't spam the out it runs continuously. i know it can be done with brackets somehow
Assistant
You're right, we can use brackets to control the flow. Try this:
move /y "R:\Temp\%%F" "R:\Temp\%%F" >nul 2>&1 && (del /f /q "R:\Temp\%%F" >nul 2>&1 && <nul set /p=-) || (if exist "R:\Temp\%%F" <nul set /p=.)This will:
- Only print
-if a file was successfully moved AND deleted - Only print
.if the move failed AND the file actually exists - Print nothing if there's no file to process
The
if existcheck ensures you don't get output when there are no files to process, preventing screen spam during idle periods.- Only print
- User
the dot needs to represent something removable, the - represents something removed
Assistant
Got it. Let's reverse the symbols to match your intent:
move /y "R:\Temp\%%F" "R:\Temp\%%F" >nul 2>&1 && (del /f /q "R:\Temp\%%F" >nul 2>&1 && <nul set /p="-") || (if exist "R:\Temp\%%F" <nul set /p=".")Now:
.means a file exists and is movable (but not yet deleted)-means a file was successfully deleted- Nothing is printed if no files exist to process
This gives you a clean visual indicator: dots for files that can be moved, dashes for files that were actually deleted, and silence when nothing is happening.
- User
dot has to come before the dash, so i can tell if it was deleted, so for any delete it wlll show dot dash, but for failed move it shows just a dot
Assistant
I understand now. You want to see the process for each file:
.when a file can be moved (is not locked)-when that file is then deleted- So a successful operation shows
.- - A failed move (locked file) shows just
.
Try this:
if exist "R:\Temp\%%F" ( move /y "R:\Temp\%%F" "R:\Temp\%%F" >nul 2>&1 && ( <nul set /p="." del /f /q "R:\Temp\%%F" >nul 2>&1 && <nul set /p="-" ) )This will:
- Check if the file exists first
- If it exists, try to move it
- If move succeeds, print
.and then try to delete - If delete succeeds, print
- - If any step fails, the chain stops at that point
- Nothing prints if no files exist
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.