Date: Wed, 3 Jul 2013 23:38:33 +0000 Subject: RE: batch script in windows not as good as a shell script in Linux/UNIX, but helpful still... PURPOSE - to setup a client in the lab. see notes to the right of "REM" (copy of script below w/o comments) REM batch file to configure new system REM john meister 3 july 2013 REM echo ============================= mkdir "c:\LAB_USER_FILES\" mkdir "c:\LAB_USER_FILES\JOHN" REM - ################################################################################## REM - # created directory structure for user files OUTSIDE of defaults - helps memory usage and file sharing REM - ################################################################################## mkdir "c:\ALL_CMDS.{ED7BA470-8E54-465E-825C-99712043E01C}" mkdir "c:\LAB_USER_FILES\ALL_CMDS.{ED7BA470-8E54-465E-825C-99712043E01C}" REM - ################################################################################## REM - # these special directories are a feature in microsoft windows 7 (and 8) that display all control panel commands REM - ################################################################################## copy \\johns-lab\C$\BIN\JOHN\* c:\LAB_USER_FILES\JOHN\ REM - ################################################################################## REM - # copying files from the lab's master computer - files include other scripts, registry hacks and executables REM - ################################################################################## cd c:\LAB_USER_FILES\JOHN\ REM - ################################################################################## REM - # changes to the new directory so all commands are executed in this directory REM - ################################################################################## echo ============================= cls set logfile=%COMPUTERNAME%_install_results.txt REM - ################################################################################## REM - # defined a variable called logfile that will have the hostname and "install results" as the title. REM - ################################################################################## echo %logfile% ECHO ================================================================== >> %logfile% echo setup conducted: %DATE% - %fulltime% >> %logfile% echo The Microsoft version listed below was run on the following system: >> %logfile% ver >> %logfile% hostname >> %logfile% ECHO ========================================================================= >> %logfile% ECHO "set registry keys for john for temp, vi, explorer and putty " >> %logfile% regedit /s "set-temp-variables-local-user.reg" regedit /s "set-vi-for-txt.reg" regedit /s "sysinternals.reg" regedit /s "Show_All_Folders_Navigation_Pane-stops-jumping-left-column.reg" regedit /s "putty-opsdevlab.reg" REM - ################################################################################## REM - # the commands above activate the registry hacks REM - ################################################################################## copy customapp.exe.lnk C:\Users\Public\Desktop echo finished at: %DATE% - %fulltime% >> %logfile% results: johns-lab-3_install_results.txt ================================================================== setup conducted: Wed 07/03/2013 - The Microsoft version listed below was run on the following system: Microsoft Windows [Version 6.1.7601] johns-lab-3 ========================================================================= "set registry keys for john for temp, vi, explorer and putty " finished at: Wed 07/03/2013 - ========================================================================= SCRIPT WITHOUT COMMENTS: ========================================================================= REM batch file to configure new system - john meister 3 july 2013 echo ============================= mkdir "c:\LAB_USER_FILES\" mkdir "c:\LAB_USER_FILES\JOHN" mkdir "c:\ALL_CMDS.{ED7BA470-8E54-465E-825C-99712043E01C}" mkdir "c:\LAB_USER_FILES\ALL_CMDS.{ED7BA470-8E54-465E-825C-99712043E01C}" copy \\johns-lab\C$\BIN\JOHN\* c:\LAB_USER_FILES\JOHN\ cd c:\LAB_USER_FILES\JOHN\ echo ============================= cls set logfile=%COMPUTERNAME%_install_results.txt echo %logfile% ECHO ================================================================== >> %logfile% echo setup conducted: %DATE% - %fulltime% >> %logfile% echo The Microsoft version listed below was run on the following system: >> %logfile% ver >> %logfile% hostname >> %logfile% ECHO ========================================================================= >> %logfile% ECHO "set registry keys for john for temp, vi, explorer and putty " >> %logfile% regedit /s "set-temp-variables-local-user.reg" regedit /s "set-vi-for-txt.reg" regedit /s "sysinternals.reg" regedit /s "Show_All_Folders_Navigation_Pane-stops-jumping-left-column.reg" regedit /s "putty-opsdevlab.reg" copy customapp.exe.lnk C:\Users\Public\Desktop echo finished at: %DATE% - %fulltime% >> %logfile% =========================================================================