@ECHO OFF
REM Computer to Network - Upload local test results to network
REM Version: 5.0 - Added user-facing ECHO for each step
REM Last modified: 2026-03-28

REM Verify MACHINE variable is set
IF "%MACHINE%"=="" GOTO NO_MACHINE

ECHO ........................................
ECHO CTONW v5.0 - Uploading %MACHINE% data to network
ECHO ........................................
ECHO CTONW.BAT v5.0 > C:\ATE\CTONW.LOG
ECHO Machine: %MACHINE% >> C:\ATE\CTONW.LOG

ECHO (1/5) Test logs -> T:\%MACHINE%\LOGS
COPY C:\ATE\5BLOG\*.DAT T:\%MACHINE%\LOGS\5BLOG
COPY C:\ATE\7BLOG\*.DAT T:\%MACHINE%\LOGS\7BLOG
COPY C:\ATE\7BLOG\*.SHT T:\%MACHINE%\LOGS\7BLOG
COPY C:\ATE\8BLOG\*.DAT T:\%MACHINE%\LOGS\8BLOG
COPY C:\ATE\DSCLOG\*.DAT T:\%MACHINE%\LOGS\DSCLOG
COPY C:\ATE\HVLOG\*.DAT T:\%MACHINE%\LOGS\HVLOG
COPY C:\ATE\PWRLOG\*.DAT T:\%MACHINE%\LOGS\PWRLOG
COPY C:\ATE\SCTLOG\*.DAT T:\%MACHINE%\LOGS\SCTLOG
COPY C:\ATE\VASLOG\*.DAT T:\%MACHINE%\LOGS\VASLOG

ECHO (2/5) Reports -> T:\%MACHINE%\Reports
COPY C:\Reports\*.TXT T:\%MACHINE%\Reports

ECHO (3/5) Text datasheets -> T:\STAGE\%MACHINE%
CALL C:\BAT\CTONWTXT.BAT

ECHO (4/5) Log files -> T:\%MACHINE%
COPY C:\ATE\*.LOG T:\%MACHINE%

ECHO (5/5) Upload complete
ECHO ........................................
GOTO END

:NO_MACHINE
ECHO ........................................
ECHO ERROR: MACHINE variable not set
ECHO Run DEPLOY.BAT or ATESYNC first
ECHO ........................................
PAUSE
GOTO END

:END
