Failed to move folders

1

I was creating a series of batch files to sort the files in my computer, which is always a mess.

Everything works great for me except one thing, moving the file folder of the html.

echo off
color 0a
set elementos=11
:loop
set /a resultado=%resultado% + 1
if %resultado%==1 (cd "%userprofile%\Downloads")
if %resultado%==2 (cd "%userprofile%\Desktop\Carpeta sin titulo")
if %resultado%==3 (cd "%userprofile%\Desktop\Nueva carpeta")
if %resultado%==4 (cd "%userprofile%\Desktop\Celu")
if %resultado%==5 (cd "%userprofile%\Desktop\Celu\Download")
if %resultado%==6 (cd "%userprofile%\Desktop\Celu\WhatsApp\Media\GBWhatsApp Documents")
if %resultado%==7 (cd "%userprofile%\Desktop\Celu\WhatsApp\Media\WhatsApp Documents")
if %resultado%==8 (cd "%userprofile%\Desktop\Celu\Telegram\Telegram Documents")
if %resultado%==9 (cd "%userprofile%\Documents\MEGA")
if %resultado%==10 (cd "%userprofile%\Documents\MEGAsync Downloads")
if %resultado%==11 (cd "%userprofile%\Desktop")
     . . .
move de varios archivos
     . . .
move "*.htm" "%userprofile%\Desktop\Archivos\html"
move "*.html" "%userprofile%\Desktop\Archivos\html"
move "*_archivos" "%userprofile%\Desktop\Archivos\html"
move "*_files" "%userprofile%\Desktop\Archivos\html"
if %resultado%==%elementos% (goto :exit)
goto :loop
:exit
cd "%userprofile%\Desktop"
echo n | move /-y "*.*" "%userprofile%\Desktop\Archivos"

In this batch I make a loop moving around in the different directories where I need to relocate and sort the files.

The problem arises when I try to move * _files and * _files, I do not read those folders and therefore do not move them.

I have no idea why he does not read them, if anyone knows why and can help me, I would appreciate it.

    
asked by Matias Cardullo 06.07.2018 в 15:11
source

2 answers

0

* _ files and * _files are folders and you want to move them to Files using this instruction:

echo n | move /-y "*.*" "%userprofile%\Desktop\Archivos"

Maybe if you put something like this down like this:

echo n | move /-y "*.*" "%userprofile%\Desktop\Archivos"
move %userprofile%\Downloads\_files %userprofile%\Desktop\Archivos\_files
    
answered by 06.07.2018 в 17:42
0

I almost solved it a while ago using a for when I put it in the cmd it works

FOR /D %x in (*_archivos) DO move "%x" "%userprofile%\Desktop\Archivos\html"
FOR /D %x in (*_files) DO move "%x" "%userprofile%\Desktop\Archivos\html"

but when I pass it for the bat it does not work

FOR /D %%x in (*_archivos) DO move "%%x" "%userprofile%\Desktop\Archivos\html"
FOR /D %%x in (*_files) DO move "%%x" "%userprofile%\Desktop\Archivos\html"
    
answered by 08.07.2018 в 05:34