Solved Move files folder by folder with bat file


My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Are you saying it worked now or just that it works on desktop but still not on D:?
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Are you saying it worked now or just that it works on desktop but still not on D:?
Desktop: it works

Inside drive D: it doesn't

In the video you can see perms
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Run the test again but make it

D:\test\test.txt

and

D:\test2\

To see if it works on D at all
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Run the test again but make it

D:\test\test.txt

and

D:\test2\

To see if it works on D at all
I execute bat file from Desktop on C it works.

So it doesn't work if I execute bat file from D to move file on D.
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
I execute bat file from Desktop on C it works.

So it doesn't work if I execute bat file from D to move file on D.
Add the following as the first line for your powershell commands:

Code:
Set-Location -Path D:\
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Add the following as the first line for your powershell commands:

Code:
Set-Location -Path D:\
1738482724478.webp

It doesn't work.

Neither If I do as admin
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Launch powershell as admin. Run:

Code:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted

and

Code:
set-executionpolicy remotesigned
Close the console and try again
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
1738486522179.webp

do you mean in this way????
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
No. Run those 2 commands in an admin powershell. Then close powershell and try your batch again. You can also remove Set-Location. That was a test
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Try this as the only line in the batch. Replace SOURCE and DESTINATION with one of yours.

Code:
Move-Item -Path D:\SOURCE\*.* -Destination D:\DESTINATION\ -Confirm -Force
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
1738489139162.webp

1738489148128.webp

Both tested.

Neither.
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
So
Code:
Move-Item -Path "D:\Bandeja de entrada\000 Móvil\Audios\*.*" -Destination "D:\Bandeja de entrada\Audios"
in powershell console works. does not work in .bat file.

Make a new .bat with this test. This is to COPY, not move. Just to test


Code:
echo off
cmd.exe /C
robocopy "D:\Bandeja de entrada\000 Móvil\Audios\*.*" "D:\Bandeja de entrada\Audios" /E
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Tested as admin, as user, in D, but none works

What about changing perms?
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
If that move-item command runs in powershell console without running as admin it doesn’t sound like permissions issues.

Read some and test some from here:

 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Some questions:

1. D:\Bandeja de entrada\000 Móvil is a hidden folders, but its subfolders not.

2. Checking what we has done, we never get move subfolders content inside D:\Bandeja de entrada\000 Móvil to D:\Bandeja de entrada subfolders.
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Is D an external drive connected locally or a network drive?
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
I don't know how to tell in English:

My laptop has two hard disk: one of them HDD (C drive, where Windows is installed) and another SSD (D drive, where I have all my information), but both are inside my laptop.

Do you understand me????
 

My Computer My Computer

At a glance

Windows 11 Home 23H2***
OS
Windows 11 Home 23H2
Computer type
Laptop
Manufacturer/Model
*
CPU
*
Motherboard
*
Memory
*
Graphics Card(s)
*
Sound Card
*
Monitor(s) Displays
*
Screen Resolution
*
Hard Drives
*
PSU
*
Case
*
Cooling
*
Keyboard
*
Mouse
*
Internet Speed
*
Browser
*
Antivirus
*
Other Info
*
Would not renaming .bat to .ps1 work? Do you have to use bat? Anyway, this seems to work for me:
Code:
start "" C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "Move-Item -Path "D:\SOURCE\*.*" -Destination "D:\DESTINATION"
If you still want to use .bat
Code:
move /y "D:\SOURCE\*.*" "D:\DESTINATION"
 
Last edited:

My Computer My Computer

At a glance

Home2FH2CanAMD Ryzen 5 8600G (07/24)2x32GB Kingston FURY DDR5 5600 MHz CL36 @5200...ASROCK Radeon RX 6600 Challenger D 8G @48FPS ...
OS
Home2FH2Can
Computer type
PC/Desktop
CPU
AMD Ryzen 5 8600G (07/24)
Motherboard
ASROCK B650M-HDV/M.2 (07/24) BIOS 4.43 AGESA ComboAM5 1.3.0.1b Patch A (07/26)
Memory
2x32GB Kingston FURY DDR5 5600 MHz CL36 @5200 CL40 (07/24)
Graphics Card(s)
ASROCK Radeon RX 6600 Challenger D 8G @48FPS (08/24)
Sound Card
Creative Sound BlasterX AE-5 Plus (05/24)
Monitor(s) Displays
24" Philips 24M1N3200ZS/00 (05/24)
Screen Resolution
1920×1080@165Hz via DP1.4
Hard Drives
Kingston KC3000 NVMe 2TB (05/24)
ADATA XPG GAMMIX S11 Pro 512GB (07/19)
PSU
Seasonic Core GM 550 Gold (04/24)
Case
Fractal Design Define 7 Mini with 3x Noctua NF-P14s/12@555rpm (04/24)
Cooling
Noctua NH-U12S with Noctua NF-P12 (04/24)
Keyboard
HP Pavilion Wired Keyboard 300 (07/24) + Rabalux 76017 Parker (01/24)
Mouse
Logitech M330 Silent Plus (07/26)
Internet Speed
500/100 Mbps via RouterOS (05/21) & TCP Optimizer
Browser
Edge, Brave for YouTube, LibreWolf for FB
Antivirus
NextDNS blocking 1/3 Traffic
Other Info
Phone: Motorola Moto G86 (02/26)
Backup: Hasleo Backup Suite (PreOS)
Headphones: Sennheiser RS170 (09/10)
Chair: Huzaro Force 4.4 Grey Mesh (05/24)
Notifier: Xiaomi Mi Band 9 Milanese (10/24)
FlexCore USB-C 3.2 Gen 1 (M) to LAN (F) (08/25)

Latest Support Threads

Back
Top Bottom