My environment variables do not work

Anonymous
2024-02-02T01:50:07+00:00

Windows Pro 11

My environment variables do not work when entering them manually for example:

C:\swigwin-4.2.0\swig.exe

If I entered my environment variables like so (in the system menu):

User variable for User:

Variable Value

SwigWing C:\swigwin-4.2.0\swig.exe

or as System variables:

Variable Value

SwigWing C:\swigwin-4.2.0\swig.exe

This is the message from my terminal:

C:\Users\User\Desktop>swig -help

'swig' is not recognized as an internal or external command,

operable program or batch file.

Now if I entered the path like so:

C:\Users\User\Desktop>C:\swigwin-4.2.0\swig -help

Supported Target Language Options

 -csharp         - Generate C# wrappers 

 -d              - Generate D wrappers 

 -go             - Generate Go wrappers 

 -guile          - Generate Guile wrappers 

 -java           - Generate Java wrappers 

 -javascript     - Generate Javascript wrappers 

 -lua            - Generate Lua wrappers

it works

I tried different variable names and paths, but if I entered them manually they do not not work.

However, if some program creates its own environmental variables the variables work.

what am I doing wrong?

Windows for home | Windows 11 | Settings

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ramesh Srinivasan 173.9K Reputation points Volunteer Moderator
    2024-02-02T02:14:29+00:00

    To invoke the environment variable, use the following syntax:

    %swigwin% -help

    Note: If all you want to do is launch swig.exe without mentioning the full path, you don't need the %SwigWin% variable. Instead, add "C:\swigwin-4.2.0" to the PATH variable.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful