Hello all,
I have to create a script that moves all the files on the desktop, downloads and documents from the computer of the user to the server. What is the best way to do this?
Hello all,
I have to create a script that moves all the files on the desktop, downloads and documents from the computer of the user to the server. What is the best way to do this?
didn’t get you on what you meant by the best way.
You would use Get-ChildItem and Move-Item cmdlet to do this. Those three folders are special folder so you can address them using
$Desktop = [environment]::GetFolderPath([System.Environment+SpecialFolder]::Desktop) $Documents = [environment]::GetFolderPath([System.Environment+SpecialFolder]::MyDocuments) $Personal = Split-Path -Path ([environment]::GetFolderPath([System.Environment+SpecialFolder]::Personal)) $Downloads = Join-Path -Path $Personal -ChildPath 'Downloads'