0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

タスクスケジューラでネットワークからのファイルコピーバッチが動かない

Posted at

1. はじめに

  • タスクスケジューラからファイルをコピーしたい
  • コピー元、コピー先をネットワークドライブにしても動くようにしたい

2. 動作環境

  • Windows 11

3. 原因

  • タスクスケジューラとして実行する場合、特定のユーザープロファイルで保持しているネットワークドライブ接続情報が使用できなくなるため

4. 対処法

  • バッチファイル内に、ネットワークドライブの割り当てと削除を記述する
rem  ネットワークドライブを割り当てる
net use X: \\TEST /user:< ユーザーID> <パスワード>

copy Y:\<ファイル名>> C:\<ファイル名>

rem ネットワークドライブを切断する
net use X: /delete

5. 参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?