# How to select certain country for exit node?

**URL:** https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080
**Category:** Tor Browser Desktop
**Tags:** tor-browser
**Created:** [August 14, 2024, 9:59am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080 "2024-08-14T09:59:29Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![BobbyB](https://forum.torproject.org/user_avatar/forum.torproject.org/bobbyb/32/5456_2.png) [@BobbyB](https://forum.torproject.org/u/BobbyB)
#### Post date: [August 15, 2024, 11:27pm UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/6 "2024-08-15T23:27:22Z")

</div>

The easiest is to edit the torrc file with a text editor and add or change the line ExitNodes {ca} then start the browser. I do it all the time when I want a specific exit node or remove it when I use to use whatever comes.

The Tor browser starts tor.exe with whatever parameters it uses.

You could make a batch file to first spit out a torrc file to use with the exit node of choice then start the Firefox browser with whatever is in your shortcut on the desktop.  
Now this batch file can be as simple or sophisticated as you want.

I would first make a copy of the current torrc file without exitnode as torrcCOPY (Remember, this is Windows. Case is not sensitive in filenames and commands. It’s just to make things more readable.)  
Change **YOURnameHERE**  
There is an intentional blank after: **Enter 2 Character Country Code:**

**-----EXAMPLE:**  
@echo off  
setlocal  
SET /P CC=Enter 2 Character Country Code:  
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” \>NUL  
echo ExitNodes {%CC%} \>\>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”  
endlocal  
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”  
**-----ENDEXAMPLE:**

**DISCLAIMER:** Supplied as is. Tested and works for me. 🙂

**EDITED LATER:**  
The original script fails to take into account the occasion where you **do not** want a specific exit node.  
The script is now modified to this:

@echo off  
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” \>NUL  
setlocal  
SET /P CC=Enter 2 Character Country Code:  
if .%CC% == . GOTO none  
echo ExitNodes {%CC%} \>\>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”  
endlocal  
:none  
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”  
😉

---

_[View the full topic](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080)._
