I know that in the unix world, if you edit your .profile or .cshrc file, you can do a source ~/.profile or source ~/.cshrc to get the effect on your current session. If I changed something in the system variable on Windows, how can I have it effect the current command prompt session without exiting the command prompt session and opening another command prompt session?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- JQ: Select when attribute value exists in a bash a
- How can I have a python script safely exit itself?
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Check if directory exists on remote machine with s
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- Making new files automatically executable?
The dos shell will support .bat files containing just assignments to variables that, when executed, will create the variables in the current environment.
IHTH.
The only way I have found this to work is to launch a new cmd window from my own config window. eg:
The last cmd will launch a new cmd prompt with the desired settings exported to the command window.
In the usual Windows command prompt (i.e. cmd.exe), just using
call mybat.bat
did what I wanted. I got all the environment variables it had set.Use git bash for windows, it works totally fine!
For example to set VC# vars
I am afraid not, but you can start using Powershell, which does support dot sourcing. Since powershell window is really based on cmd so all your dos command will continue to work, and you gain new power, much more power.