0

based on this question

I want to move ( not copy) files with a specific extension to another folder which is not a sub or the parent. The hierarchy is as follows

enter image description here


I need the path to be relative, file names unknown, The batch file will be in the same folder "source" , the files I want to move all are of a particular extension.

I have tried this in a .bat file:

move cd %~dp0\*.txt cd %~dpi\dest

as well as this

move  %~dp0\*.txt %~dpi\dest

and this

move  %~dp0\*.txt %~dp0\dest

I have also tried running the .bat when it is in the parent folder with

move %~dp0\source\*.json %~dp0\dest

none give any error, and the files are not moved from the source folder

Mel
  • 174
  • 1
  • 11

1 Answers1

0

It should just be

move *.txt ..\dest

if you're standing in source and want to move to dest.

thebjorn
  • 26,297
  • 11
  • 96
  • 138