回答編集履歴
1
別解追記
test
CHANGED
@@ -31,4 +31,17 @@
|
|
31
31
|
|
32
32
|
rmdir /s /q %MY_WORK%
|
33
33
|
```
|
34
|
+
# 追記:最初の案で遅延環境変数展開を使わずサブルーチンを使う
|
35
|
+
```CMD
|
36
|
+
setlocal
|
37
|
+
for /f "usebackq delims=" %%A in (
|
38
|
+
`python -c "import os;print(os.system('python test.py'))"`
|
39
|
+
) do call :SUB "%%~A"
|
40
|
+
echo OUTPUT=%RESULT% CC=%CC%
|
41
|
+
exit /b
|
34
42
|
|
43
|
+
:SUB
|
44
|
+
set "RESULT=%CC%"
|
45
|
+
set "CC=%~1"
|
46
|
+
exit /b
|
47
|
+
```
|