Move files folder by folder with bat file


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

System One

  • 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

System One

  • OS
    Windows 11 Home 23H2
    Computer type
    Laptop
Launch powershell as admin. Run:

Code:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted

and

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

My Computer

System One

  • OS
    Windows 11 Pro
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

System One

  • OS
    Windows 11 Pro
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

System One

  • OS
    Windows 11 Pro
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

System One

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

What about changing perms?
 

My Computer

System One

  • OS
    Windows 11 Home 23H2
    Computer type
    Laptop
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

System One

  • 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

System One

  • OS
    Windows 11 Home 23H2
    Computer type
    Laptop
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

System One

  • OS
    Windows 11 Home 23H2
    Computer type
    Laptop
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

System One

  • OS
    Windows 11 Home
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 8600G (07/24)
    Motherboard
    ASROCK B650M-HDV/M.2 3.15 (07/24)
    Memory
    2x32GB Kingston FURY DDR5 5600 MHz CL36 @4800 CL40 (07/24)
    Graphics Card(s)
    ASROCK Radeon RX 6600 Challenger D 8G @60FPS (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 (04/23)
    Internet Speed
    500/100 Mbps via RouterOS (05/21) & TCP Optimizer
    Browser
    Edge & Brave for YouTube & LibreWolf for FB
    Antivirus
    NextDNS
    Other Info
    Backup: Hasleo Backup Suite (PreOS)
    Headphones: Sennheiser RS170 (09/10)
    Phone: Samsung Galaxy Xcover 7 (02/24)
    Chair: Huzaro Force 4.4 Grey Mesh (05/24)
    Notifier: Xiaomi Mi Band 9 Milanese (10/24)
    2nd Monitor: AOC G2460VQ6 @75Hz (02/19)

Latest Support Threads

Back
Top Bottom