简体   繁体   中英

execute c-programfiles from CMD in windows

I have recently installed MinGW to my computer, to compile and run programs written in c.

Right now I have to manually go to the bin-folder to execute and compile files.

The path is C:\\MinGW\\bin

Is there aa way to avoid this everytime? I want be able to directly write the commands when I open the command Line.

I tried to follow the Environment Settings on http://www.mingw.org/wiki/Getting_Started

but it does not work at all.

在此处输入图片说明

A simple solution would be a small batch script. Create a new batch file with this code:

@echo off
cd C:\MinGW\bin
:loop
set /p var=
%var%
goto loop

Could you show me your user environment variable called " path "? Maybe we will find the error there.

Edit: Create a new environment variable in the upper field (user-environment variables). Enter this in the window which appears.

Name:  PATH
Value: C:\MinGW\bin

This should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM