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

[Origin]: http://stackoverflow.com/questions/273159/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
shareedit

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

[From:] http://superuser.com/questions/332109/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


Update:

Problem

You are seeing Ú instead of é

Analysis

é 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.

Solution

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.

before

after

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.

Start->Run->regedit
Go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
And change the "OEMCP" value to "1252"

chcp command found on ComputerHope.com

shareimprove this answer

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

[From]: http://stackoverflow.com/questions/18234894/batch-change-special-characters-from-filenames-%C3%A9-%C3%A8-%C3%A0

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%"

Output:

"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.

shareedit

Call Python From Bat File And Get Return Code

[From]: http://stackoverflow.com/questions/1013246/call-python-from-bat-file-and-get-return-code

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

python somescript.py
echo %ERRORLEVEL%

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

exit(15)

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

from sys import exit
exit(15)