PHP, 22 bytes
1 if the path separator is semicolon (colon or empty for all other OSs except for DOS and OS/2), else nothing.
also 22 bytes, but not that safe:
prints a positive integer if the file path contains a backslash; else nothing.
A safe alternative with 27 bytes:
1 or nothing.
A strange find:
<?=__FILE__==":"; (20 bytes) should be, not safe either, but ok.
__FILE__ pretends to be a string (I tried
gettype), indexing it throws an error, unless you copy it somewhere else (concatenation also works) or use it as a function parameter.
<?=(__FILE__)==":"; (also 22 bytes) works in PHP 7; but that´s because the parentheses copy the constant´s value to a temporary variable.
tests if predefined
PHP_OS constant starts with
win (case insensitive; Windows,WIN32,WINNT, but not CYGWIN or Darwin); prints
1 for Windows, else nothing.
1 if it was stored with Windows linebreak (also on DOS, OS/2 and Atari TOS - although I doubt that anyone ever compiled PHP for TOS), else
You could also check the constant
dll on Windows, but not necessarily only there.
php_uname() returns info on the operating system and more; starts with
Windows for Windows.
$_SERVER['HTTP_USER_AGENT'] will contain
Windows when called in a browser on Windows.
<?=defined(PHP_WINDOWS_VERSION_BUILD); (38 bytes) works in PHP>=5.3
The only failsafe way to tell if it´s really Windows, not anything looking like it, seems to be a check on the OS name. For PHP:
php_os() may be disabled for security reasons; but
PHP_OS will probably always contain the desired info.