Advertisement
Old-Lost

Recreate Junctions

Jan 8th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'd','e' | % {Get-ChildItem -Recurse -Directory ${_}:\} | ? linktype -eq 'Junction' | % {Write-Output ('New-Item -ItemType Junction -Path "{1}" -Name "{2}" -Value "{0}"' -f $_.Target[0],(Split-Path $_.FullName),(Split-Path $_.FullName -Leaf))}
  2.  
  3. New-Item -ItemType Junction -Path "D:\" -Name "Projects" -Value "E:\Documents\Projects"
  4. New-Item -ItemType Junction -Path "D:\" -Name "PS" -Value "E:\Documents\WindowsPowerShell"
  5. New-Item -ItemType Junction -Path "D:\" -Name "WindowsPowerShell" -Value "E:\Documents\Projects\TrackerScripts"
  6. New-Item -ItemType Junction -Path "E:\" -Name "My Documents" -Value "E:\Documents"
  7. New-Item -ItemType Junction -Path "E:\Documents" -Name "Dropbox" -Value "E:\Dropbox"
  8. New-Item -ItemType Junction -Path "E:\Documents" -Name "Projects" -Value "E:\Dropbox\SAPIEN\Projects"
  9. New-Item -ItemType Junction -Path "E:\Documents" -Name "SAPIEN" -Value "E:\Dropbox\SAPIEN"
  10. New-Item -ItemType Junction -Path "E:\Documents" -Name "UltraEdit" -Value "E:\Dropbox\UltraEdit"
  11. New-Item -ItemType Junction -Path "E:\Documents" -Name "Visual Studio 2010" -Value "e:\Dropbox\Visual Studio 2010"
  12. New-Item -ItemType Junction -Path "E:\Documents" -Name "WindowsPowerShell" -Value "E:\Dropbox\WindowsPowerShell\"
  13. New-Item -ItemType Junction -Path "E:\My Documents" -Name "Dropbox" -Value "E:\Dropbox"
  14. New-Item -ItemType Junction -Path "E:\My Documents" -Name "Projects" -Value "E:\Dropbox\SAPIEN\Projects"
  15. New-Item -ItemType Junction -Path "E:\My Documents" -Name "SAPIEN" -Value "E:\Dropbox\SAPIEN"
  16. New-Item -ItemType Junction -Path "E:\My Documents" -Name "UltraEdit" -Value "E:\Dropbox\UltraEdit"
  17. New-Item -ItemType Junction -Path "E:\My Documents" -Name "Visual Studio 2010" -Value "e:\Dropbox\Visual Studio 2010"
  18. New-Item -ItemType Junction -Path "E:\My Documents" -Name "WindowsPowerShell" -Value "E:\Dropbox\WindowsPowerShell\"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement