Skip to content

Instantly share code, notes, and snippets.

@7cc
Last active March 21, 2019 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7cc/70be1c88bd735c9b7801f876937434fa to your computer and use it in GitHub Desktop.
Save 7cc/70be1c88bd735c9b7801f876937434fa to your computer and use it in GitHub Desktop.

Windowsでフォルダーを別ドライブに移動する

cmd.exe の move は同一ドライブ間でしか移動できない。
エラーメッセージ "アクセスは拒否されました"

cmd.exe

移動先にフォルダーネーム必須

robocopy /MOVE /E <folder_name> D:\foo\bar\<folder_name>

/MOVE: 移動
/E: 空ディレクトリでもコピー

xcopy /IE <folder_name> D:\foo\bar\<folder_name>
del <folder_name>

/I: ディレクトリ
/E: 空ディレクトリでもコピー

powershell

Move-Item <folder_name> D:\foo\bar\

Git Bash

mv <folder_name> /d/foo/bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment