Move files from sub folders to the main folder

Thank you very much ..
I have downloaded the script file named "Collapse-Folder.ps1" and found the same original path without change ..
I am confused why is not working for me ..

Can the script be edited to pick up the folder path or this feature is not included in PowerShell?
 
Yasser,

Nothing needs to be changed in the script it works. Something else is going on.

Try this:

  1. Create folder called Scripts in your Documents Folder.
  2. Copy the file from the zip file into this folder.
  3. Start PowerShell
  4. At the PowerShell Prompt PS> Type: C:\Users\Future\Documents\Scripts\Collapse-Folder.ps1 -BasePath "C:\USERS\Future\Desktop\MainFolder" -Quiet


HTH :cool:
 
I have applied the same steps exactly but got the same error ...
Never mind about it .. I don't want to disturb you any more
Thank you very much for great help and patience
 
I have searched a lot till I found something working for me
In PowerShell I typed this line
Code:
$files = ls C:\Users\Future\Desktop\MainFolder -recurse -Include *.* |foreach-object{Move-Item $_ C:\Users\Future\Desktop\Collection -force}

This is not exactly what I was seeking for but it is working well no problem ..
My target was to move all the files in the sub folders to the main root and delete the empty directories .. But it is okay now
 
Code:
Sub M_snb()
   CreateObject("scripting.filesystemobject").MoveFile "G:\OF\*.jpg", "G:\"
End Sub
 
Code:
Sub M_snb()
   CreateObject("scripting.filesystemobject").MoveFile "G:\OF\*.jpg", "G:\"
End Sub
Thank you very much Mr. snb
I appreciate a lot sharing the issue .. This code is working well for the files in the main folder but it doesn't move the files in the sub folders
 
Please do not use genderspecific qualifications you cannot derive from an alias.

Please try to learn from suggestions.
 
I get called Sir all the time! ;)

I think the OP is just trying to be respectful.
 
@snb
Please do not use genderspecific qualifications you cannot derive from an alias.
I don't understand this sentence. Can you make it in other words as I didn't get it?

@AliGW
I'm sorry for not calling you Sir ...But If you like it, I will do certainly Sir AliGW
 
@AliGW
I'm sorry for not calling you Sir ...But If you like it, I will do certainly Sir AliGW

LOL!!! My comment was, of course, tongue-in-cheek: I hope my forum avatar shows clearly that I am not a Sir! ;)

I don't understand this sentence. Can you make it in other words as I didn't get it?

SNB is asking you not to make assumptions about his/her gender (sex) when you do not and cannot know what that is. In other words, don't call him Mr SNB. :)
 
Back
Top