How to determine if a port is open on a Windows server?


Assuming that it’s a TCP (rather than UDP) port that you’re trying to use:

  1. On the server itself, use netstat -an to check to see which ports are listening
  2. From outside, just telnet host port (or telnet host:port on Unix systems) to see if the connection is refused, accepted, or timeouts

On that latter test, then in general:

  • connection refused means that nothing is running on that port
  • accepted means that something is running on that port
  • timeout means that a firewall is blocking access

How can I configure the Command Prompt to display French correctly?


Try “PowerShell ISE” not “PowerShell” – it understands UTF-8 and other character sets.

enter image description here



You are seeing Ú instead of é


é is at code point 0xE9 in ISO 8859-1 Latin-1 (and several similar encodings)
Ú is at code point 0xE9 in code page 850

Therefore your application is emitting text using Latin-1 encoding. However your console is set for code page 850.


Using chcp to change the console encoding will, in conjunction with an appropriately encoded font, most likely solve the problem.

I can reproduce the problem and fix it by changing the command prompt properties to change the font from “Raster” to “Lucida Console”. The Raster fonts have what Microsoft refer to as an OEM encoding.



shareimprove this answer

Try changing the code page with the chcp command. For example:

C:\ chcp 1252

I say 1252 because this guy seemed to have success with it for displaying French characters.

If that works there is still another step because it is reset with every command prompt window. I haven’t tested this out but according to this site it will change the code page for all future command prompt windows.

Go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
And change the "OEMCP" value to "1252"

chcp command found on

shareimprove this answer

BATCH : Change special characters from filenames (é è à…)


Batch can properly manage any Ascii character, that is, characters with code below or equal 255. This is obvious, because the Batch code itself must also be written in Ascii.

@echo off
set remove=áéíóúÜü
set string=Aaá Eeé Iií Ooó UuÜüú It Works!
for /F "tokens=1-26 delims=%remove%" %%a in ("%string%") do (
   set newString=%%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z
echo "%newString%"


"Aa Ee Ii Oo Uu It Works!"

If the characters you want to remove are not Ascii (codes above 255), then a Batch program can not solve this problem.


Call Python From Bat File And Get Return Code


The windows shell saves the return code in the ERRORLEVEL variable:


In the python script you can exit the script and set the return value by calling exit():


In older versions of python you might first have to import the exit() function from the sys module:

from sys import exit