if "%OS%"=="Windows_NT" setlocal
Hi have a batch script and I wonder why is checking OS version? Are there differences in batch syntax with Windows 95/98?
I am with Windows 7 and echo %OS%
is Windows_NT
why?
if "%OS%"=="Windows_NT" setlocal
Hi have a batch script and I wonder why is checking OS version? Are there differences in batch syntax with Windows 95/98?
I am with Windows 7 and echo %OS%
is Windows_NT
why?
setlocal
doesn't work on non-NT systems, as simple as that.
It's not exactly easy to find, but you'll see that it is in documentation of the command processor for NT 4.0, Windows XP etc., while it's missing in 95, 98 etc. (which use the MS-DOS command processor rather than the NT shell).
Windows 7 is a Windows NT system, just like Windows 2000, XP, or Windows Server 2008, for example. The version number is in fact a continuation of the line - Windows NT 4.0 being followed by 2000 (5.0), XP (5.1+), Vista (6.0), 7 (6.1) etc.