LoginSignup
1
1

More than 1 year has passed since last update.

batを作ってみたメモ1

Posted at

毎日同じサイトを立ち上げるのが面倒だったのでbat叩いたら立ち上がるようにしてみた。
batファイルはコマンドプロンプトに実行させたい命令をテキストファイルに書いたもので、unix系ではシェルスクリプトに相当するらしい。

環境 windows 10
エディタ VSCode

routine.bat
@echo off
start chrome URL 
start outlook.exe
if exist "PATH*.xls" (start "" "PATH\hogehoge.xls") 
echo SetUp...
pause

これを実行すればchromeとoutlooxとexcelが立ち上がる。

VSCodeの標準はUTF-8だが、コマンドラインでテキストを扱う場合sjisが標準らしい。
そこでVSCodeのワークスペースに追記して、batファイルをsjisで開いたり保存したりしてもらうようにした。

hoge.code-workspace
"settings": {
        "[bat]": {
            "files.encoding": "shiftjis"
        }
    }

これでワークスペース内のbatファイルはVSCodeが勝手にsjisでやってくれる。

ログインも自動化しようとwsl2上にpython+seleniumしようとしたけど環境構築失敗したのでそのうち再挑戦します。

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