Announcement

Collapse
No announcement yet.

shutdown command different in xp and win 7

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • shutdown command different in xp and win 7

    guys, because the shutdown command has different switches in xp and windows 7: xp use -r, and win 7 uses /r, so I need to check for os type before running the correct shutdown syntax, I know that for xp I could use %os%==windows_nt, but what would be that case for windows 7? is it the same?... how to differentiate the two with script?

  • #2
    Re: shutdown command different in xp and win 7

    Most simple solution is use the /r switch also in Windows XP (it works).

    To check the OS version in a batchfile there are several ways, here's one:
    Code:
    @echo off
    
    >nul (ver.exe |find.exe /i "WindOws XP") &&Set "WINVER=WINXP" ||Set "WINVER=other"
    
    
    If /i "%WINVER%" EQU "WINXP" (
      echo WinVER=%WINVER%
    ) ELSE (
      echo Not XP, %WINVER%
    )
    
    pause
    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: shutdown command different in xp and win 7

      Thanks... that helped!

      Comment

      Working...
      X