If you have a script that you require to be launched when the current directory is set to a specific path, you can use the following technique to abort the script:

@echo off
<font size="1">if /i "%CD%" NEQ "SpecificCurrentDirectory" @echo The %0 script was launched with the following current directory: %CD%&exit /b 1</font>
:: Continue

<h3>Example</h3>
To only run if the current directory is the Windows folder:

@echo off
<font size="1">if /i "%CD%" NEQ "%SystemRoot%" @echo The %0 script was launched with the following current directory: %CD%&exit /b 1</font>
:: Continue