Windows cmd筆記 主要是AppVeyor

https://ss64.com/nt/cmd.html
http://steve-jansen.github.io/guides/windows-batch-scripting/part-2-variables.html

變數要看 for /?



use in kvirc .appveyor.yml 把變數前三個字元跳過
    - '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%ssl_arch:~3%.bat"'


  - if exist VCdeps.7z (curl -kLo VCdeps.7z https://ci.appveyor.com/api/projects/craftwar_appveyor/obs-deps/artifacts/VCdeps.7z -f --retry 5 -z VCdeps.7z) else (curl -kLo VCdeps.7z https://ci.appveyor.com/api/projects/craftwar_appveyor/obs-deps/artifacts/VCdeps.7z -f --retry 5 -C -)

output stderr to file
dir > a.txt 2>&1

AppVeyor的各種修正
記錄用,也許能學到一些有用的指令

.sh extension is not properly mapped on VS 2017 image 
https://github.com/appveyor/ci/issues/1881

cmd /c ftype sh_auto_file="C:\msys64\usr\bin\bash.exe" "`"%L`"" %* | out-null
cmd /c assoc .sh=sh_auto_file
 

 
 
Batch file: Find if substring is in string (not in a file) 
https://stackoverflow.com/questions/7005951/batch-file-find-if-substring-is-in-string-not-in-a-file
 
if not x%str1:bcd=%==x%str1% echo It contains bcd

The %str1:bcd=% bit will replace a bcd in str1 with an empty string, making it different from the original. 

留言

這個網誌中的熱門文章

OBS 抓不到畫面, 視窗, 遊戲擷取, 黑或白畫面, 當掉 ,卡住, black/white screen, window game capture, crash, freeze

優化實況(一) OBS設定 streaming settings

OBS plugin obs-text 顯示播放中音樂, display playing music