-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAID-Gen-v2.bat
61 lines (52 loc) · 1.75 KB
/
AID-Gen-v2.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
53
54
55
56
57
58
59
60
61
@echo off
color a
setlocal enabledelayedexpansion
:: Get user input for timeout duration
set /p timeoutSeconds="Enter timeout duration (in seconds): "
:: Get user input for the number of IDs
set /p numIDs="Enter the number of IDs to process: "
:: Initialize variables
set progress=0
set increment=100
:: Calculate the increment percentage for progress bar
set /a increment=100/%numIDs%
:: Begin the process
for /l %%i in (1, 1, %numIDs%) do (
cls
echo ================================================
echo AnyDesk Automation Script
echo ================================================
echo Processing ID %%i of %numIDs%
:: Progress bar display
set /a progress+=increment
if !progress! gtr 100 set progress=100
call :ProgressBar !progress!
:: Perform operations
taskkill /IM Anydesk.exe >nul 2>&1
mkdir C:\AID-GEN\Output\AD%%i >nul 2>&1
start C:\AID-GEN\AnyDesk.exe
timeout /t %timeoutSeconds% >nul
cd /d %AppData% >nul
copy AnyDesk C:\AID-GEN\Output\AD%%i >nul 2>&1
taskkill /IM Anydesk.exe >nul 2>&1
del /f /s /q AnyDesk >nul 2>&1
rmdir /s /q AnyDesk >nul 2>&1
)
:: Completion message
cls
echo ================================================
echo Process Completed Successfully
echo ================================================
pause
exit /b
:ProgressBar
:: Display a progress bar
:: %1 = progress percentage (0-100)
set /a completed=%1/2
set /a remaining=50-%completed%
set barCompleted=
set barRemaining=
for /l %%j in (1, 1, !completed!) do set barCompleted=!barCompleted!#
for /l %%j in (1, 1, !remaining!) do set barRemaining=!barRemaining!-
echo [!barCompleted!!barRemaining!] %1%%
exit /b