I am trying to create a script (cmd) in Windows to move files of any type of extension from one folder to another but it is giving me problem after problem, every time I execute it I get the error "You can not find the specified route", I've already tried everything but I do not know where I fail, here's the script I've been doing so far:
:============================|
: Script para mover archivos |
:============================|
@echo off
cls
setlocal enabledelayedexpansion
set /p tipo="¿Que tipo de archivos desea copiar? Introduzca su extension..."
echo Usted quiere mover los archivos de tipo ".%tipo%"
echo.
set /p origen="Introduzca la ruta de origen..."
echo La ruta de origen seleccionada ha sido: %origen%
echo.
set /p destino="Introduzca la ruta de destino..."
echo Sus archivos se copiaran en el siguiente destino: %destino%
echo.
for /f %%a in ('dir /s /b "%origen%"^|find ".%tipo%"') do (
echo Moviendo:
echo.
echo %%a
move "%%a" "%destino%"
)
echo.
echo Sus archivos se han movido correctamente.
timeout /t 5
echo.
echo Gracias por usar mi script.
pause >nul