Skip to content

Instantly share code, notes, and snippets.

@CountChu
Last active October 23, 2016 07:30
Show Gist options
  • Save CountChu/1b5b7dbba37c6d968040437986ce8f67 to your computer and use it in GitHub Desktop.
Save CountChu/1b5b7dbba37c6d968040437986ce8f67 to your computer and use it in GitHub Desktop.
Use Python to change a system environment variable
python ChgEnv.py %1
call Temp.bat
import sys
File = open ("Temp.bat", "w+")
File.write ("set DDD=%s\n" % sys.argv [1])
File.close ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment