0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Windows] netuseコマンドで共有フォルダーにアクセスする方法

Posted at

はじめに

このたびデータベースからデータを取得し、それをCSVに変換するパワーシェルスクリプトを作成しました。
そして、上記のパワーシェルスクリプトをコマンドで実行したとき問題はありませんが、Windowsが提供するスケジュールでは動作しませんでした。
原因は正確にはわかりませんが、解決方法としてまずファイルサーバーに接続した後、コピーを試みるとファイルをコピーすることができました。

net use使い方

# 様式
net use \\サーバー\パス /user:ユーザー パスワード
# 例
net use \\192.168.1.3\test /user:idtest password1234
# ファイルコピー
xcopy C:\Users\Administrator\temp\test\*.csv  \\192.168.1.3\test -y
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?