39 lines
759 B
Batchfile
39 lines
759 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
set "SRC=%~dp0Software"
|
|
set "DESKTOP=%USERPROFILE%\Desktop"
|
|
set "NEXT_DIR=%DESKTOP%\next"
|
|
set "DST=%NEXT_DIR%\Software"
|
|
|
|
if not exist "%NEXT_DIR%\" (
|
|
mkdir "%NEXT_DIR%"
|
|
)
|
|
|
|
if not exist "%SRC%\" (
|
|
echo [ERROR] Source folder not found: "%SRC%"
|
|
exit /b 1
|
|
)
|
|
|
|
echo Copying from "%SRC%" to "%DST%"...
|
|
robocopy "%SRC%" "%DST%" /E /R:2 /W:1
|
|
set "RC=%ERRORLEVEL%"
|
|
|
|
if %RC% GEQ 8 (
|
|
echo [ERROR] Copy failed. Robocopy exit code: %RC%
|
|
exit /b %RC%
|
|
)
|
|
|
|
echo Copying script files (*.bat, *.ps1) to "%NEXT_DIR%"...
|
|
|
|
for %%F in ("%~dp0*.bat") do (
|
|
if exist "%%~fF" copy /Y "%%~fF" "%NEXT_DIR%\" >nul
|
|
)
|
|
|
|
for %%F in ("%~dp0*.ps1") do (
|
|
if exist "%%~fF" copy /Y "%%~fF" "%NEXT_DIR%\" >nul
|
|
)
|
|
|
|
echo [OK] Copy completed. Software RC=%RC%
|
|
exit /b 0
|