This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$#" -gt 0 ]; then | |
| # 获取最后一个参数,参数放在前面,要打包的路径放在最后 | |
| allarg="$*" | |
| last_arg="${!#}" | |
| if [[ "$last_arg" == "." || "$last_arg" == ".." ]]; then | |
| echo "请勿打包 . .. 目录,会导致产生的压缩文件被打包,造成问题" | |
| exit 1 | |
| fi | |
| target_dir=$(dirname "${!#}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal enabledelayedexpansion | |
| chcp 65001 >nul | |
| REM bat default is ANSI(gbk) set to utf-8 | |
| echo 脚本很可能需要管理员权限才能获取显示器SN | |
| where pwsh >nul 2>nul | |
| if %errorlevel% equ 0 ( | |
| echo "use PowerShell 7(pwsh)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal enabledelayedexpansion | |
| REM 遍历所有可能的盘符 | |
| for %%D in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( | |
| REM 检查盘符是否存在 | |
| if exist %%D:\ ( | |
| echo ------------------------------- | |
| echo [%date% %time%] 检查 %%D:\ |