target 1: run python in local machine
- simple
@echo off
python test.py
echo.
echo ** Please click the "X" button in the upper-right corner to close this window **
:loop
timeout /t 1 /nobreak >nul
tasklist | find "cmd.exe" >nul
if not errorlevel 1 goto loop
- activate conda activate
the tartget exe file is %windir%\System32\cmd.exe "/K" C:\Users\zhaib\MiniConda3\Scripts\activate.bat C:\Users\zhaib\MiniConda3
,
extract C:\Users\zhaib\MiniConda3\Scripts\activate.bat C:\Users\zhaib\MiniConda3
set into the following code.
@echo off
call C:\Users\zhaib\MiniConda3\Scripts\activate.bat C:\Users\zhaib\MiniConda3
call activate env_pytorch
:: do not use call conda activate env_pytorch or call source activate env_pytorch
python test.py
echo.
echo ** Please click the "X" button in the upper-right corner to close this window **
:loop
timeout /t 1 /nobreak >nul
tasklist | find "cmd.exe" >nul
if not errorlevel 1 goto loop
target 2: login remote linux system to execute python code
don’t know how to implement.
others
- close the windows only user click the top-right x
echo.
echo ** Please click the "X" button in the upper-right corner to close this window **
:loop
timeout /t 1 /nobreak >nul
tasklist | find "cmd.exe" >nul
if not errorlevel 1 goto loop