-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathzip_and_copy.bat
More file actions
55 lines (43 loc) · 1.22 KB
/
zip_and_copy.bat
File metadata and controls
55 lines (43 loc) · 1.22 KB
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
@echo off
setlocal enabledelayedexpansion
REM Check if a folder was dropped on the batch file
if "%~1"=="" (
echo No folder provided. Please drag and drop a folder onto this batch file.
pause
exit /b 1
)
REM Get the dropped folder path
set "folder_path=%~1"
REM Remove quotes if present
set "folder_path=%folder_path:"=%"
REM Check if the path exists and is a directory
if not exist "%folder_path%" (
echo Error: Path does not exist: %folder_path%
pause
exit /b 1
)
if not exist "%folder_path%\*" (
echo Error: Path is not a directory: %folder_path%
pause
exit /b 1
)
echo Folder to process: %folder_path%
echo.
REM Prompt for username
set /p "username=Enter username (default: analytics): "
REM If no username entered, use default
if "!username!"=="" set "username=analytics"
echo Using username: !username!
echo.
REM Call the Python script with the provided parameters
C:\\Python\\Python38\\python.exe zip_and_copy.py "%folder_path%" --username "!username!" --no-prompt
REM Check if Python script was successful
if %errorlevel% neq 0 (
echo.
echo Python script failed with error code: %errorlevel%
pause
exit /b %errorlevel%
)
echo.
echo Batch file completed successfully.
pause