-
Notifications
You must be signed in to change notification settings - Fork 1
/
Supplement.bat
52 lines (37 loc) · 977 Bytes
/
Supplement.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
echo === GitHub Daily Attendance : Supplement ===
rem check Administrator
net session 1>NUL 2>NUL && (
goto gotAdmin
) || (
goto UACPrompt
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
:begin
rem Get:date --> mkdir:date
cd %~dp0
cd .\Supplement\
set /p targetDate=Target-date:
set today=%date%
echo ==================
echo Target-date: %targetDate%
echo Today: %today%
echo ==================
date %targetDate%
md "%date:~2,2%%date:~5,2%%date:~8,2%"
cd "%date:~2,2%%date:~5,2%%date:~8,2%"
echo # GitHub-Daily-Attendance : Supplement >> README.md
cd ..
cd ..
rem Git:push --> Origin:main
git add -A
git commit -m "Daily attendance : Supplement"
git push -u origin main
date %today%
pause