To run a program with custom env settings, we do this on Linux
$ MYVAR=23 ./foo.py
On Windows, the only way I know of is:
C:\> set MYVAR=23
C:\> .\foo.py
C:\> REM unset MYVAR here (but how?)
But can’t this done be as an one-liner?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It should be noted that batch files are parsed one line at the time, so one liners like this are problematic there (setlocal ENABLEDELAYEDEXPANSION can help out in those cases)