+ Post New Thread
Results 1 to 2 of 2
Windows Thread, checking os version in logon script in Technical; basically a 3rd parts installed a 2003 ts a while back. Im now trying to test windows 7 (x64) and ...
  1. #1


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,577
    Thank Post
    228
    Thanked 853 Times in 732 Posts
    Rep Power
    294

    checking os version in logon script

    basically a 3rd parts installed a 2003 ts a while back. Im now trying to test windows 7 (x64) and with the users logon script it fails (if it helps it a kix script) but ideally as i never liked what they did anyway i want to change ad to point at a vbs/batch that pretty much says is os>6 do x if os<6 run the kix script

    ive seen a batch file but i need to specifiy for every version of windows what to do surely theres a simpler way of saying <6 >6?

    Code:
    @ECHO OFF
    VER | findstr /l "5.0." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running 2000
    
    VER | findstr /l "5.1." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running Win xp
    
    VER | findstr /l "5.2." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running Win 2003
    
    VER | findstr /l "6.0." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running Vista
    
    VER | findstr /l "6.0." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running Vista
    
    VER | findstr /l "6.1." > nul
    IF %ERRORLEVEL% EQU 0 ECHO Running windows 7
    
    :end
    pause

  2. #2


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,577
    Thank Post
    228
    Thanked 853 Times in 732 Posts
    Rep Power
    294
    well that was simple doh!
    (granted it launches notepad on win7 atm but thats just a placeholder
    Code:
    @ECHO OFF
    
    VER | findstr /l "6.1." > nul
    IF %ERRORLEVEL% EQU 0 (notepad) else (\\server\netlogon\kix32.exe \\server\netlogon\logon.kix)

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 8
    Last Post: 25th February 2009, 09:50 AM
  2. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  3. BGInfo in logon script example?
    By ninjabeaver in forum How do you do....it?
    Replies: 16
    Last Post: 24th August 2007, 12:49 PM
  4. Yet another Logon Script
    By ajbritton in forum Windows
    Replies: 3
    Last Post: 19th June 2006, 09:47 AM
  5. Stupid CMD error with logon script
    By tarquel in forum Windows
    Replies: 37
    Last Post: 14th June 2006, 09:07 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •