.bat file can not find my vs 2017 ,how to solve it?

  Uncategorised

enter image description here

like the picture showing. I run the .bat file to start the vs 2017 , but it doesn’t work.

The error says: "ERROR: Visual Studio 2013, 2015 or 2017 is not found in the system."

I have already installed vs 2017, and I can open it from the .exe, but it couldn’t be found when using bat file(named ifortvars.bat).

@echo off
:: ============================================================================
:: Copyright 1985-2018 Intel Corporation All Rights Reserved.
::

:: The source code,  information and material ("Material")  contained herein is
:: owned by Intel Corporation or its suppliers or licensors,  and title to such
:: Material remains with Intel Corporation or its suppliers  or licensors.  The
:: Material contains  proprietary  information  of Intel  or its  suppliers and
:: licensors.  The Material is protected by worldwide copyright laws and treaty
:: provisions.  No part  of the  Material   may be  used,  copied,  reproduced,
:: modified,  published,   uploaded,   posted,   transmitted,   distributed  or
:: disclosed in any way without Intel's prior  express written  permission.  No
:: license under any patent,  copyright  or other intellectual  property rights
:: in the Material is granted to or conferred upon you,  either  expressly,  by
:: implication,  inducement,  estoppel  or otherwise.  Any  license  under such
:: intellectual  property  rights must  be  express and  approved  by  Intel in
:: writing.
::
:: Unless otherwise  agreed by  Intel in writing,  you may not  remove or alter
:: this notice or  any other notice  embedded in Materials by  Intel or Intel's
:: suppliers or licensors in any way.
:: ============================================================================

:: Cache some environment variables.
set BIN_ROOT=%~dp0
set SCRIPT_NAME=%~nx0

:: Set the default arguments
set TARGET_VS=
set TARGET_ARCH=
set C_TARGET_ARCH=
set LP64_ILP64=
set QUIET=

:ParseArgs
:: Parse the incoming arguments
if /i "%1"==""        goto Build
if /i "%1"=="ia32"         (set TARGET_ARCH=ia32)         & (set C_TARGET_ARCH=ia32)    & shift & goto ParseArgs
if /i "%1"=="intel64"      (set TARGET_ARCH=intel64)      & (set C_TARGET_ARCH=intel64) & shift & goto ParseArgs
if /i "%1"=="vs2013"       (set TARGET_VS=vs2013)                                       & shift & goto ParseArgs
if /i "%1"=="vs2013shell"  (set TARGET_VS=vs2013)                                       & shift & goto ParseArgs
if /i "%1"=="vs2015"       (set TARGET_VS=vs2015)                                       & shift & goto ParseArgs
if /i "%1"=="vs2015shell"  (set TARGET_VS=vs2015)                                       & shift & goto ParseArgs
if /i "%1"=="vs2017"       (set TARGET_VS=vs2017)                                       & shift & goto ParseArgs
if /i "%1"=="lp64"         (set LP64_ILP64=lp64)                                        & shift & goto ParseArgs
if /i "%1"=="ilp64"        (set LP64_ILP64=ilp64)                                       & shift & goto ParseArgs
if /i "%1"=="quiet"        (set QUIET=quiet)                                            & shift & goto ParseArgs
if /i "%1"=="-arch"        shift & goto ParseArgs
if /i "%1"=="-platform"    shift & goto ParseArgsPlatform 

goto Syntax

:ParseArgsPlatform
if /i "%1"==""        goto Syntax
if /i "%1"=="android"      (set TARGET_PLATFORM=android) & shift & goto ParseArgs
if /i "%1"=="linux"        (set TARGET_PLATFORM=linux)   & shift & goto ParseArgs

goto ParseArgs 

:Build

:: target architecture is mandatory
if /i "%TARGET_ARCH%"=="" goto Syntax

:: set correct defaults
if /i "%TARGET_PLATFORM%"==""     (call :GetFileName "%BIN_ROOT%.." ROOT_ROOT_NAME)
if /i "%ROOT_ROOT_NAME%"=="linux" (set TARGET_PLATFORM=linux)

:: main actions
if exist "%BIN_ROOT%..daalbindaalvars.bat" @call "%BIN_ROOT%..daalbindaalvars.bat" %C_TARGET_ARCH% %TARGET_VS%
if exist "%BIN_ROOT%..tbbbintbbvars.bat" @call "%BIN_ROOT%..tbbbintbbvars.bat" %C_TARGET_ARCH% %TARGET_VS%
if exist "%BIN_ROOT%..pstlbinpstlvars.bat" @call "%BIN_ROOT%..pstlbinpstlvars.bat" %C_TARGET_ARCH% %TARGET_VS%
if exist "%BIN_ROOT%..mklbinmklvars.bat" @call "%BIN_ROOT%..mklbinmklvars.bat" %C_TARGET_ARCH% %TARGET_VS% %LP64_ILP64%
if exist "%BIN_ROOT%..ippbinippvars.bat" @call "%BIN_ROOT%..ippbinippvars.bat" %C_TARGET_ARCH% %TARGET_PLATFORM% %TARGET_VS%
if exist "%BIN_ROOT%..ippcpbinippcpvars.bat" @call "%BIN_ROOT%..ippcpbinippcpvars.bat" %C_TARGET_ARCH% %TARGET_PLATFORM% %TARGET_VS%
if exist "%FNL_DIR%%C_TARGET_ARCH%binfnlsetup.bat" @call "%FNL_DIR%%C_TARGET_ARCH%binfnlsetup.bat"
if exist "%BIN_ROOT%......debugger_2019bindebuggervars.bat" @call "%BIN_ROOT%......debugger_2019bindebuggervars.bat" %C_TARGET_ARCH%
if exist "%BIN_ROOT%..mpi%C_TARGET_ARCH%binmpivars.bat" @call "%BIN_ROOT%..mpi%C_TARGET_ARCH%binmpivars.bat" %QUIET%
if exist "%BIN_ROOT%compilervars_arch.bat" @call "%BIN_ROOT%compilervars_arch.bat" %TARGET_ARCH% %TARGET_VS% %TARGET_PLATFORM% %QUIET%

exit /B 0

:Syntax
echo Syntax:
echo  %SCRIPT_NAME% [-arch] ^<arch^> [vs] [-platform ^<platform^>] 
echo.
echo    ^<arch^> must be is one of the following
echo        ia32         : Set up for IA-32 target
echo        intel64      : Set up for Intel(R) 64 target
echo    If specified, ^<vs^> must be one of the following
echo        vs2013      : Set to use Microsoft Visual Studio* 2013
echo        vs2013shell : Set to use Microsoft Visual Studio* Shell 2013
echo        vs2015      : Set to use Microsoft Visual Studio* 2015
echo        vs2015shell : Set to use Microsoft Visual Studio* Shell 2015
echo        vs2017      : Set to use Microsoft Visual Studio* 2017
echo    If ^<vs^> is not specified, the version of Visual Studio* detected at install
echo    time is used.
echo    ^<platform^> must be of the following.  
echo        linux          : Set to Linux* target.      
echo        android        : Set to Android* target.
echo.
exit /B 1

:GetFileName
SET %2=%~n1
GOTO :EOF

This code is the bat file that I talk about. It’s in the folder named "…IntelSWToolscompilers_and_libraries_2019.0.117windowsbin"

I need to use this bat file because my Abaqus program needs it and ivf to use fortran.

I think this problem happens for some modifying in the system, but I don’t know where has been changed and how to change it back.

Anyone could help me? Thanks anyway.

Source: Visual Studio Questions

LEAVE A COMMENT