I need to move users Desktop data, as some are 1GBs in sizes to there home drives (my documents) and create shortcuts in there place.
How is this best achieved
Technology Tips and News
I need to move users Desktop data, as some are 1GBs in sizes to there home drives (my documents) and create shortcuts in there place.
How is this best achieved
Here is something to get you started:
$WScriptShell = New-Object -ComObject WScript.Shell Get-ChildItem "$env:USERPROFILE\Desktop" -Exclude "*.url", "*.lnk" | ForEach-Object { $Moved = Move-Item -Path $_.FullName -Destination "$env:USERPROFILE\Documents" -PassThru $TargetFile = $Moved.FullName $ShortcutFile = $_.FullName -replace $_.Extension, '.lnk' $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) $Shortcut.TargetPath = $TargetFile $Shortcut.Save() }