how to replace del with move | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to replace del with move

for /f "skip=7 eol=: delims=" %F in ('dir /b /o-d /a-d *.sav') do @del "%F" how to replace del with move

30th Mar 2021, 2:53 AM
Steven
Steven - avatar
6 Answers
+ 2
Can you please specify which language it is for ex python, c++, java etc
30th Mar 2021, 3:18 AM
Aysha
Aysha - avatar
+ 2
I think you are trying to open your file in command prompt
30th Mar 2021, 3:27 AM
Aysha
Aysha - avatar
+ 2
Steven Do one thing the file which you are going to open Just right click Go to properties Copy the target location Then paste it in command prompt I hope it will work
30th Mar 2021, 3:28 AM
Aysha
Aysha - avatar
0
basic, i think... it runs in command prompt and i have managed to almost figure it out... for /f "skip=2 eol=: delims=" %F in ('dir /b /o-d /a-d *.sav') do @move /Y "%F" "C:\Users\steve\AppData\Roaming\Surviving Mars\old mars" but it wont work for .bat
30th Mar 2021, 3:20 AM
Steven
Steven - avatar
0
not quite... I'm trying to move everything but the most recent X number of files to a specific place.
30th Mar 2021, 3:40 AM
Steven
Steven - avatar
0
figured it out cmd < "C:\Users\steve\AppData\Roaming\Surviving Mars\Auto move.txt" Auto move.txt says CD C:\Users\steve\AppData\Roaming\Surviving Mars\save for /f "skip=2 eol=: delims=" %F in ('dir /b /o-d /a-d *.sav') do @move /Y "%F" "C:\Users\steve\AppData\Roaming\Surviving Mars\old mars" thanks for trying
30th Mar 2021, 4:15 AM
Steven
Steven - avatar