|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
We are currently using .bat files for our login scripts
Yaya I know so 1998 Anyways until we can switch to .vbs or anything else I need to put some code in the .bat login script to not run if it's a windows 2003 server The IT guys still need login scripts but I don't want them running on the servers. -- David Lewis Information Technology Manager Cubellis |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Wed, 3 Sep 2008 15:46:47 -0700, "David Lewis" <*@*.*> wrote in
microsoft.public.windows.server.scripting: >We are currently using .bat files for our login scripts >Yaya I know so 1998 >Anyways until we can switch to .vbs or anything else >I need to put some code in the .bat login script to not run if it's a >windows 2003 server >The IT guys still need login scripts but I don't want them running on the >servers. Parse the output of the command: VER. -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
"David Lewis" <*@*.*> wrote in message news:%230GP1bhDJHA.3392@TK2MSFTNGP03.phx.gbl... > We are currently using .bat files for our login scripts > Yaya I know so 1998 > Anyways until we can switch to .vbs or anything else > I need to put some code in the .bat login script to not run if it's a > windows 2003 server > The IT guys still need login scripts but I don't want them running on > the servers. > This is covered extensively in Timo Salmi's most excelent CMD.EXE scripting FAQ: See http://www.netikka.net/tsneti/info/tscmd004.htm Hope that s! Dave |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"David Lewis" <*@*.*> wrote:
>We are currently using .bat files for our login scripts Yaya I know so 1998mAnyways until we >can switch to .vbs or anything elseuI need to put some code in the .bat login script to not run >if it's a Awindows 2003 server<The IT guys still need login scripts but I don't want them >running on the 8servers.oft-- mDavid LewisJInformation Technology Manager<Cubellis This should you, Win 98 echo %os% would not work but ver works, I found this on the web: @ECHO OFF :: Win9x checks :::::::::::: VER |find /i "Windows 95" >NUL IF NOT ERRORLEVEL 1 GOTO W9598ME VER |find /i "Windows 98" >NUL IF NOT ERRORLEVEL 1 GOTO W9598ME VER |find /i "Windows Millennium" >NUL IF NOT ERRORLEVEL 1 GOTO W9598ME :: NT/XP checks :::::::::::: VER | find "XP" > nul IF %errorlevel% EQU 0 GOTO s_win_XP VER | find "2000" > nul IF %errorlevel% EQU 0 GOTO s_win_2000 VER | find "NT" > nul IF %errorlevel% EQU 0 GOTO s_win_NT ECHO Unknown OS ! GOTO :EOF :: Win9x commands :::::::::::: :W9598ME ECHO Win9x commands go here GOTO :EOF :W98 ECHO Win98 commands go here GOTO :EOF :: NT/XP commands :::::::::::: :s_win_XP ECHO XP commands go here goto :eof :s_win_2000 ECHO WIN2K commands go here goto :eof :s_win_NT ECHO NT4 commands go here goto :eof :EOF (End-of-file)Service Pack Version rem I found this here: rem http://www.fortypoundhead.com/showcontent.asp?ArtID=837 Have a good one! http:/www.filegod.netfirms.com |
|
![]() |
| Outils de la discussion | |
|
|