Web Listing 1: ToolsMenu.bat @ECHO OFF SETLOCAL :top :: If the utilities you're using are on a remote location, specify that location in the Set command below without a trailing backslash. :: Example: SET UtilLocation=\\server1\tools SET UtilLocation= :: This code puts a trailing backslash on the UtilLocation path if you specified it above. IF NOT "%UtilLocation%"=="" SET UtilLocation=%UtilLocation%\ :: Build the menu ECHO *************** Menu *************** :: ECHO What command or tool would you like to run? ECHO. ECHO A) Local (Lists the membership of a local group) ECHO B) Global (Lists the membership of a global group) ECHO C) Findgrp (Determine the local groups a user is a member of) ECHO D) PsloggedOn (Identify who is logged onto a remote node) ECHO E) UpTime (Determine node uptime and bluescreen info) ECHO F) Srvinfo (See hotfix and basic config info on remote node) ECHO G) IPconfig (IP configuration info on a remote note) ECHO H) Net Send (Send a pop-up message to a computer or user) ECHO I) Time Sync Check (compares logon server time to remote node) ECHO J) TBD ECHO K) TBD ECHO L) TBD ECHO M) TBD ECHO N) TBD ECHO O) TBD ECHO P) TBD ECHO Q) TBD ECHO R) TBD ECHO S) TBD ECHO T) TBD ECHO U) TBD ECHO V) TBD ECHO W) TBD ECHO X) To EXIT %UtilLocation%choice /N /C:ABCDEFGHIJKLMNOPQRSTUVWX What command would you like to run? :: Check the errorlevel and goto the appropriate routine. IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO :LocalRoutine IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO :GlobalRoutine IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO :FindgrpRoutine IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO :PSloggedonRoutine IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 GOTO :UptimeRoutine IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 GOTO :SrvInfoRoutine IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 GOTO :IPConfigRoutine IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 GOTO :NetSendRoutine IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 GOTO :TimeSyncCheckRoutine IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 ECHO TBD IF ERRORLEVEL 11 IF NOT ERRORLEVEL 12 ECHO TBD IF ERRORLEVEL 12 IF NOT ERRORLEVEL 13 ECHO TBD IF ERRORLEVEL 13 IF NOT ERRORLEVEL 14 ECHO TBD IF ERRORLEVEL 14 IF NOT ERRORLEVEL 15 ECHO TBD IF ERRORLEVEL 15 IF NOT ERRORLEVEL 16 ECHO TBD IF ERRORLEVEL 16 IF NOT ERRORLEVEL 17 ECHO TBD IF ERRORLEVEL 17 IF NOT ERRORLEVEL 18 ECHO TBD IF ERRORLEVEL 18 IF NOT ERRORLEVEL 19 ECHO TBD IF ERRORLEVEL 19 IF NOT ERRORLEVEL 20 ECHO TBD IF ERRORLEVEL 20 IF NOT ERRORLEVEL 21 ECHO TBD IF ERRORLEVEL 21 IF NOT ERRORLEVEL 22 ECHO TBD IF ERRORLEVEL 22 IF NOT ERRORLEVEL 23 ECHO TBD IF ERRORLEVEL 23 IF NOT ERRORLEVEL 24 ECHO TBD IF ERRORLEVEL 24 ENDLOCAL & GOTO :EOF GOTO :top :: The subroutines that run the various tools appear below. :: Use them as a pattern to add other tools to the menu. :: ******************************************************************* :LocalRoutine CLS SET gpname= SET domain= ECHO Type Exit at any time to exit the Local utility routine. SET /P gpname=Type the groupname and press Enter: ECHO. IF /I "%gpname%"=="exit" GOTO :top SET /P domain=Type the domainname and press Enter: ECHO. IF /I "%domain%"=="exit" GOTO :top @ECHO. %UtilLocation%local "%gpname%" %domain% @ECHO. GOTO :top :: ******************************************************************* :GlobalRoutine CLS SET ggpname= SET gdomain= ECHO Type Exit at any time to exit the Local utility routine. SET /P ggpname=Type the groupname and press Enter: ECHO. IF /I "%ggpname%"=="exit" GOTO :top SET /P gdomain=Type the domainname and press Enter: ECHO. IF /I "%gdomain%"=="exit" GOTO :top ECHO. %UtilLocation%global "%ggpname%" %gdomain% ECHO. GOTO :top :: ******************************************************************* :FindgrpRoutine CLS SET fgname= SET fgdomain= ECHO Type Exit at any time to exit the Findgrp utility routine. SET /P fgname=Type the "userdomain\username" and press Enter: ECHO. IF /I "%fgname%"=="exit" GOTO :top SET /P fgdomain=Type the domainname or \\servername and press Enter: ECHO. IF /I "%fgdomain%"=="exit" GOTO :top ECHO. %UtilLocation%findgrp %fgdomain% "%fgname%" /L ECHO. GOTO :top :: ******************************************************************* :PSloggedonRoutine CLS SET pscompname= ECHO Type Exit at any time to exit the PSloggedOn utility routine. SET /P pscompname=Type the computername and press Enter: ECHO. IF /I "%pscompname%"=="exit" GOTO :top ECHO. %UtilLocation%psloggedon -L "\\%pscompname%" ECHO. GOTO :top :: ******************************************************************* :UptimeRoutine CLS SET utcompname= ECHO Type Exit at any time to exit the UpTime utility routine. SET /P utcompname=Type the computername and press Enter: ECHO. IF /I "%utcompname%"=="exit" GOTO :top ECHO. %UtilLocation%uptime /s /a "\\%utcompname%" ECHO. GOTO :top :: ******************************************************************* :SrvInfoRoutine CLS SET sicompname= ECHO Type Exit at any time to exit the SrvInfo utility routine. SET /P sicompname=Type the computername and press Enter: ECHO. IF /I "%sicompname%"=="exit" GOTO :top ECHO. %UtilLocation%srvinfo -ns "\\%sicompname%" ECHO. GOTO :top :: ******************************************************************* :IPConfigRoutine CLS SET ipcompname= ECHO Type Exit at any time to exit the IPConfig utility routine. SET /P ipcompname=Type the computername and press Enter: ECHO. IF /I "%ipcompname%"=="exit" GOTO :top ECHO. %UtilLocation%psexec "\\%ipcompname%" IPCONFIG /ALL ECHO. GOTO :top :: ******************************************************************* :NetSendRoutine CLS SET nsname= SET message= ECHO Type Exit at any time to exit the Net Send Messaging utility routine. ECHO Type the username or computername you want to send a message to SET /P nsname=then press Enter: ECHO. IF /I "%nsname%"=="exit" GOTO :top ECHO Type in the message you want to send SET /P message=then press Enter: ECHO. IF /I "%message%"=="exit" GOTO :top ECHO. net send "%nsname%" "%message%" ECHO. GOTO :top :: ******************************************************************* :TimeSyncCheckRoutine CLS SET TSCcompname= ECHO Type Exit at any time to exit the Time Sync Check utility routine. SET /P TSCcompname=Type the computername and press Enter: ECHO. IF /I "%TSCcompname%"=="exit" GOTO :top ECHO. For /F "tokens=*" %%i in ('NET TIME \\%TSCcompname% ^| find /V /I "command"') do ECHO %%i For /F "tokens=*" %%i in ('NET TIME %LOGONSERVER% ^| find /V /I "command"') do ECHO %%i ECHO. GOTO :top :: *******************************************************************