Hello, Long time lurker here. I am in a bit of a bind, and thought that one of the genius minds at mdl might be able to help me out. I need to figure out away to move or copy the red highlighted items into a newly created sub directory green based on a string. E:/EasyDent4/File Server/Files/Sub013011/p20130115_094721_0000.BMP E:/EasyDent4/File Server/Files/Sub013022/c20130227_160800_0000.BMP E:/EasyDent4/File Server/Files/Sub012100/c20121003_152539_0000.BMP i need something to say looking inside E:/EasyDent4/File Server/Files/ for file ending in (red) xxxxx.bmp and if its found create (green) directory and copy or move file into there. Hope i explained this well enough and that someone is willing to share their knowledge. Thank you
@lildude491 I know you asked for a powershell script and i wanted to help you, but my knowledge in powershell is 0, so i made you a batch script instead, if you're interested. (change extension to .bat) Edit the script and change the 2 vars 'base_dir' and 'target_ext' as needed. If you want to copy the files instead of moving them, just change the move command at: Code: move /y "%current_file%" "%subDir%\%current_file%" >nul 2>&1 && ( View attachment specific_move.txt
Hi lildude491, Long time viewer and my first contribution. I actually had another account but somehow could not post with that one. Anway, I hope you like the powershell script I wrote attached. Just change the .txt to .ps1 and you can edit it using Powershell ISE. Have fun! View attachment Move-FilesBasedOnFilename.txt Best Regards, Glego
@wk-952 and Glego THANK YOU SO MUCH. Honestly thought the thread was just going to die off. Greatly appreciated. I will post the results once I have run through everything. Need to set an appointment/schedule down time with the site this is for.