Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Setting environment variables for Windows cmd temporarily, to run a program, in a single line?

You could run a batch file with a setlocal

or on cmd line start another cmd.exe which inherits the current environment but changes are volatile.

cmd /c "SET MYVAR=1&myprogram.exe" 

Try this command:

set Foo=bar & abc.exe & set Foo=

This command does:

  1. Set Foo variable with bar value.
  2. Run abc.execommand.
  3. Unset Foo variable by adding blank value.

Tags:

Windows

Command Line

Environment Variables

Related

Chrome 72+ seems to no longer accept --proxy-pac-url Why isn't `tail -f … | grep -q …` quitting when it finds a match? how to open this type of flat cable connector? Disable feedback when typing password at a sudo prompt Is it possible to rotate YouTube videos while watching on desktop PC? Wireguard server and openvpn client - Forward traffic from wg0 to tun0 (openvpn tunnel) Cron runs only once instead every minute scp: error: unexpected filename: What are differences between VBoxVGA, VMSVGA and VBoxSVGA in VirtualBox? Trying to watch Netflix on Debian using Firefox Search-and-Replace RegEx Capture Group with a Number How to exit from stuck full screen application on Windows 10?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy