Reputation: 2641
The following batch file is not woking.
Can anyone help me with this?.@echo off
python -c "print('echo text')" > %TEMP%\test.bat
call %TEMP%\test.bat
edit:
I needed unix eval functionality in windows. I could not find a direct way though.
So I redirected the eval string to a temporary batch file and executed it. The temporary batch file was successfully created but calling it did not work in the above case.
I noticed that any command after the test.bat
creation did not work.
Upvotes: 1
Views: 241
Reputation: 1006
If the "python" you are calling is a batch file (python.bat in the path perhaps?) then the launching batch file will abort after calling it, unless you use the Call command like you are doing for temp.bat.
So perhaps
will give you better mileage?@echo off
call python -c "print('echo text')" > %TEMP%\test.bat
call %TEMP%\test.bat
Upvotes: 3