一々カット & ペ-ストするのが面倒だから模索した。
手順
1.PowerShell Script 作成
『SendTo.ps1』
Set-StrictMode -version Latest
Add-Type -AssemblyName System.Windows.Forms;
$global:SendTo = "<送り先のパスを設定してください>";
$global:Cpation = "送る";
if (-not (Test-Path $global:SendTo)) {
$text = "送り先:${global:SendTo}にアクセスできませんでした...";
$input = [System.Windows.Forms.MessageBox]::Show($text, $global:Cpation, "OK", "Error");
Throw $text;
}
foreach ($arg in $args) {
$isFolder = (Get-Item $arg) -is [System.IO.DirectoryInfo];
try {
if ($isFolder) {
Copy-Item $arg -Destination $global:SendTo -Recurse -Force
} else {
Copy-Item $arg -Destination $global:SendTo -Force
}
} catch {
$text = "${filename}のコピーに失敗しました...";
$input = [System.Windows.Forms.MessageBox]::Show($text, $global:Cpation, "OK", "Error");
Throw $text;
}
try {
if($isFolder){
Remove-Item $arg -Recurse -Force
} else {
Remove-Item $arg -Force
}
} catch {
$text = "${filename}の削除に失敗しました...";
$input = [System.Windows.Forms.MessageBox]::Show($text, $global:Cpation, "OK", "Error");
Throw $text;
}
}
2.Windows バッチ作成
『SendTo.bat』
@echo off
chcp 65001 > nul
cd /d %~dp0
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -File SendTo.ps1 %1
*
SendTo.ps1 と同じフォルダに格納する事。
3.Custom Context Menu
1.インスト-ル
Windows 11 から新調された右クリックメニュ-をカスタマイズできる『Custom Context Menu』をインスト-ルする。