0 Replies Latest reply on Oct 17, 2012 11:38 AM by bjohnsto

    Batch file to run mini-scan, display computer name & IP address

    Rookie

      I created a batch file for users to run that will display the computer name, ip address, and run miniscan.exe.  With this our call center and service desk technicians will be able to have the user run that to display the computer's name and ip address and update LANDesk with the machine's IP address.  The batch file identifies and runs proper commands for Win XP, Win 7 x86, & Win 7 x64.

       

      Below is the batch code.  Files are attached including an executable.

       

      @echo off

       

       

      setlocal

       

       

      Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0

       

       

      REM Check Windows Version

      ver | findstr /i " 5\." > nul

      IF %ERRORLEVEL% EQU 0 goto ver_XP

       

       

      ver | findstr /i " 6\." > nul

      IF %ERRORLEVEL% EQU 0 goto ver_Win7

      goto warn_and_exit

       

       

       

       

      :ver_Win7

      :Run Windows Vista/7

      REG.exe Query %RegQry% > checkOS.txt

      Find /i "x86" < CheckOS.txt > StringCheck.txt

       

      If %ERRORLEVEL% == 0 (

          goto x86

      ) ELSE (

          goto x64

      )

       

       

      :x86

      hostname

      ipconfig | find "IPv4" | find /v "192.168."

      "c:\Program Files\LANDesk\LDClient\miniscan.exe"

      del checkos.txt

      del stringcheck.txt

      Pause

       

       

      goto end

       

       

      :x64

      hostname

      ipconfig | find "IPv4" | find /v "192.168."

      "c:\Program Files (x86)\LANDesk\LDClient\miniscan.exe"

      del checkos.txt

      del stringcheck.txt

      Pause

       

       

      goto end

       

       

      :ver_XP

      :Run Windows XP specific commands here

      hostname

      ipconfig | find "IP Address" | find /v "192.168."

      "c:\Program Files\LANDesk\LDClient\miniscan.exe"

      del checkos.txt

      del stringcheck.txt

      Pause

       

       

      goto end

       

       

      :warn_and_exit

      echo Machine OS cannot be determined. Software not installed.

      seterror 5

       

       

      :end

       

       

      endlocal