I've got an existing installation of Cygwin on my Windows 10 machine. Because I'm beginning to work with socket programming within a Windows environment I want to look at using MinGW.
I have them both on my machine, but want to look at simple ways of 'hot swapping' between them. There is a previous question here: GCC on Cygwin coexisting with MinGW which has the following .cmd file:
@echo off
rem file: start cmd with cygwin's path
cmd.exe /k path=C:\cygwin\bin;%path%
Now if I run this as administrator a couple of things happen which I don't at this point understand:
- If a navigate to
control panel -> system -> advanced system settings -> Advanced tab -> Environment Variables -> edit path
- nothing shows... - However, if I simply type
path
into a cmd prompt it shows theC:\cygwin\bin
.
So I suppose my questions are:
a. whats the difference between the above?
b. If the .cmd file adds a path item, whats the easiest way of taking one out?
My thinking is if I don't have anything in my path, then typing gcc --version
into a cmd prompt should show an error which it doesn't at the moment due to point 2 above.
Hopefully, I've made sense. Any help much appreciated as always.
Rob
EDIT 1: I found the following: Command line to remove an environment variable from the OS level configuration
which has the following command prompt:
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V FOOBAR
This is used to delete a system variable FOOBAR
. Now if someone with more experience than me could point me in the direction of how to delete part of a system variable...