1
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.

Powershellを使ったWindows作業ディレクトリ自動化ツール

Posted at

Powershellを使ってWindows OSで何か作業をするときの作業ディレクトリ自動化ツールを開発いたしました。

# 日付を取得する。
$date = Get-Date -Format "yyyyMMdd"
# 作業用フォルダー名を取得する
$DIR_PATH = "C:\work\$date"
# 作業用フォルダーを作成する
mkdir $DIR_PATH
# 正しくmkdirコマンドができたか確認する
if ($? -eq "True")
{
    echo "Success"
}
else
{
    echo "Failure"
    exit 1
}
# フォルダーの存在確認
if (Test-Path $DIR_PATH){
    echo "Success make Folder"
} else {
    echo "Not success make Folder"
    exit 1
}
exit 0

Powershellを使った自動化ツールを色々作成しています。今回は作業フォルダーの自動化ツールを記事にしました。

1
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
1
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?