Once you have used su.bat (from the previous article), you can use this one to change to the directory that contains a specific INF file. It uses one of the files output by the build process.
inf inf-file-name
Here is the text for the batch file. It assumes that su.bat has already been used.
@IF NOT "%1" == "" GOTO STEP0
@echo.
@echo Usage:
@echo inf inf-base-name
@echo.
@echo Options:
@echo inf-base-name Name of the INF file in the current project without .INF
@echo.
@echo Description:
@echo This script changes the current directory to the directory which
@echo contains the specified INF file for the current project.
@echo.
@echo The current project must already be set using su.bat
@goto exit
:STEP0
@IF NOT "%PROJECTTIP%"=="" GOTO STEP1
@echo Project not set. Please select a project tip using SU <project-name> <project-version>.
goto exit
:STEP1
@IF EXIST "%PROJECTTIP%\temp\module.list" GOTO STEP2
@echo Project %PROJECTTIP% not built.
goto exit
:STEP2
@FOR /F "tokens=1,2" %%G IN (%PROJECTTIP%\temp\module.list) DO @IF "%%~nH"=="%1" cd %%~pH
:exit
[Updated to add help information]



Comments