@echo off
REM Read control auth cookie into variable
set /p auth_cookie=<Browser\TorBrowser\Data\Tor\control_auth_cookie
REM Create file with control commands
echo AUTHENTICATE "%auth_cookie%"> commands.txt
echo SIGNAL NEWNYM>> commands.txt
echo QUIT>> commands.txt
REM Connect to control port and issue commands
nc localhost 9151 < commands.txt
REM Delete commands file
del /Q commands.txt
When you run it, you should see the following output:
C:\Users\user\Desktop\Tor Browser>control.bat
250 OK <-- in response to AUTHENTICATE
250 OK <-- in response to SIGNAL NEWNYM
250 closing connection