Forked from ipcjs/+Windows 10 Add Copy-Paste as Symbolic Link or Junction.md
Created
July 4, 2024 21:33
-
-
Save yanegorz/c93331dc8efa8b6d5c90e37ade450efd to your computer and use it in GitHub Desktop.
Revisions
-
ipcjs revised this gist
Sep 23, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,5 @@ # Windows 10 Add Copy-Paste as Symbolic Link or Junction English: Add a menu item of `Paste Symlink` to the Windows right-click menu 中文:给Windows的右键菜单添加`粘贴成符号链接`的菜单项 -
ipcjs revised this gist
Sep 23, 2020 . 2 changed files with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Windows 10 Add Copy-Paste as Symbolic Link or Junction This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,5 +4,5 @@ Windows Registry Editor Version 5.00 @="Paste Symlink" [HKEY_CLASSES_ROOT\Directory\Background\shell\1_PasteSymlink\command] @="powershell.exe -File \"C:\\GitHub\\gist\\82e4385532be90eac99546df99a2854d\\paste-symlink.ps1\" -location \"%V\"" -
ipcjs revised this gist
Aug 8, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\1_PasteSymlink] @="Paste Symlink" [HKEY_CLASSES_ROOT\Directory\Background\shell\1_PasteSymlink\command] @="powershell.exe -File \"D:\\GitHub\\gist\\82e4385532be90eac99546df99a2854d\\paste-symlink.ps1\" -location \"%V\"" -
ipcjs revised this gist
Jul 3, 2019 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,12 +22,18 @@ else { else { # When enable develper mode, New-Item require admin on some computer, but mklink no require... why?!! # New-Item -ItemType SymbolicLink -Name $file.name -Target $file # `file.Attributes` to check path is a directory is invalid on some computer...replace to `Test-Path`. # if ($file.Attributes -eq 'Directory') { if ((Test-Path $file -PathType Container) -eq $true) { # Write-Output "dir" cmd /c mklink /d $file.name $file } else { # Write-Output "file" cmd /c mklink $file.name $file } # Pause } } } -
ipcjs revised this gist
Jun 10, 2019 . 1 changed file with 10 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # Add windows Explorer Right-Click menu to paste copied item as SymbolicLink with PowerShell # Locate file on D:\GitHub\gist\82e4385532be90eac99546df99a2854d\ param ( [Parameter(Mandatory = $true)][string]$location @@ -20,7 +20,14 @@ else { Pause } else { # When enable develper mode, New-Item require admin on some computer, but mklink no require... why?!! # New-Item -ItemType SymbolicLink -Name $file.name -Target $file if ($file.Attributes -eq 'Directory') { cmd /c mklink /d $file.name $file } else { cmd /c mklink $file.name $file } } } } -
ipcjs revised this gist
Jun 10, 2019 . 2 changed files with 19 additions and 28 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,35 +1,26 @@ # Add windows Explorer Right-Click menu to paste copied item as Junction or SymbolicLink with PowerShell # Locate file on C:\CMD\ param ( [Parameter(Mandatory = $true)][string]$location ) Set-Location $location $files = Get-Clipboard -Format FileDropList $count = $files.count; if ($count -eq 0) { Write-Output "No file(s) in clipboard" Pause } else { Write-Output "Making Junction/Link of $count files" foreach ($file in $files) { if ( (Test-Path $file.Name) -eq $true ) { Write-Output "$($file.Name) Exists" Pause } else { New-Item -ItemType SymbolicLink -Name $file.name -Target $file } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\a_PasteSymlink] @="Paste Symlink" [HKEY_CLASSES_ROOT\Directory\Background\shell\a_PasteSymlink\command] @="powershell.exe -File \"D:\\GitHub\\gist\\82e4385532be90eac99546df99a2854d\\paste-symlink.ps1\" -location \"%V\"" -
ndunks created this gist
Sep 30, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ # Add windows Explorer Right-Click menu to paste copied item as Junction or SymbolicLink with PowerShell # Locate file on C:\CMD\ param ( [Parameter(Mandatory=$true)][string]$location ) Set-Location $location $files = Get-Clipboard -Format FileDropList $count = $files.count; if($count -eq 0) { echo "No file(s) in clipboard" pause exit } echo "Making Junction/Link of $count files" foreach ($file in $files) { if( (Test-Path $file.Name) -eq $true ){ echo "$($file.Name) Exists" }else{ if($file.Attributes -eq 'Directory') { #echo "Junction: $($file.Name) -> $file" New-Item -ItemType Junction -Name $file.name -Target $file } else { #echo "SymLink : $($file.Name) -> $file" New-Item -ItemType SymbolicLink -Name $file.name -Target $file } } } pause This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\runas] @="Paste Symlink" [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command] @="powershell.exe -File \"C:\\CMD\\paste-symlink.ps1\" -location \"%V\""