0

I am new and I am not pro in scripting. BTW, i am trying to figure out something wrong with my batch file. It will auto close the window at goto checkversion.

@echo off
:start
start /wait \.Programs18.09.2017\AcroRdrDC1701220093_en_US.exe
start /wait \.Programs18.09.2017\AdobeAIRInstaller.exe
start /wait \.Programs18.09.2017\ccsetup534.exe
start /wait \.Programs18.09.2017\directx_Jun2010_redist.exe
start /wait \.Programs18.09.2017\flashplayer_27_ax_debug.exe
start /wait \.Programs18.09.2017\flashplayer_27_plugin_debug.exe
start /wait \.Programs18.09.2017\jre-8u144-windows-i586.exe
start /wait \.Programs18.09.2017\K-Lite_Codec_Pack_1350_Basic.exe
start /wait \.Programs18.09.2017\sw_lic_full_installer.exe
start /wait \.Programs18.09.2017\wlsetup-all.exe

:checkbit
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)

:32bit
start /wait \.Programs18.09.2017\ChromeStandaloneSetup.exe
start /wait \.Programs18.09.2017\FirefoxSetup55.0.3-32bit.exe
start /wait \.Programs18.09.2017\vlc-2.2.6-win32.exe
start /wait \.Programs18.09.2017\wrar550.exe
goto checkversion

:64bit
start /wait \.Programs18.09.2017\ChromeStandaloneSetup64.exe
start /wait \.Programs18.09.2017\FirefoxSetup55.0.3-64bit.exe
start /wait \.Programs18.09.2017\jre-8u144-windows-x64.exe
start /wait \.Programs18.09.2017\vlc-2.2.6-win64.exe
start /wait \.Programs18.09.2017\winrar-x64-550.exe
goto checkversion

:checkversion
setlocal
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
if "%version%" == "6.1"
echo Windows 7 Detected.
IF EXIST "%PROGRAMFILES(X86)%" (GOTO win764bit) ELSE (GOTO win732bit)
:win732bit
start /wait \.Programs18.09.2017\MSEInstall-32bit.exe
start /wait \.Programs18.09.2017\mpam-fe-32bit.exe
start /wait \.Programs18.09.2017\14.0.4734.1000_ProfessionalPlus_volume_x86_en-us\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal

:win764bit
start /wait \.Programs18.09.2017\MSEInstall-64bit.exe
start /wait \.Programs18.09.2017\mpam-fe-64bit.exe
start /wait \.Programs18.09.2017\14.0.4734.1000_ProfessionalPlus_volume_x86_en-us\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal

if "%version%" == "6.3"
echo Windows 8.1 Detected.
IF EXIST "%PROGRAMFILES(X86)%" (GOTO win864bit) ELSE (GOTO win832bit)
:win832bit
start /wait \.Programs18.09.2017\mpam-fe-32bit.exe
start /wait \.Programs18.09.2017\14.0.4734.1000_ProfessionalPlus_volume_x86_en-us\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal

:win864bit
start /wait \.Programs18.09.2017\mpam-fe-64bit.exe
start /wait \.Programs18.09.2017\14.0.4734.1000_ProfessionalPlus_volume_x86_en-us\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal

if "%version%" == "10.0"
echo Windows 10 Detected.
IF EXIST "%PROGRAMFILES(X86)%" (GOTO win1064bit) ELSE (GOTO win1032bit)
:win1032bit
start /wait \.Programs18.09.2017\mpam-fe-32bit.exe
start /wait \.Programs18.09.2017\Office_2013_64bit\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal

:win1064bit
start /wait \.Programs18.09.2017\mpam-fe-64bit.exe
start /wait \.Programs18.09.2017\Office_2013_64bit\setup.exe
echo Done installing..
echo Please restart your PC.
pause
endlocal
B. Desai
  • 16,092
  • 5
  • 22
  • 43
imahman
  • 1
  • 1
  • 2
    Possible duplicate of [How to prevent auto-closing of console after the execution of batch file.](https://stackoverflow.com/questions/988403/how-to-prevent-auto-closing-of-console-after-the-execution-of-batch-file) – Scuzzy Sep 21 '17 at 05:16
  • You are giving little detail. How are you running the batch file? By double clicking it? if so, you will not see errors because the window is closing, well as per your question it is. So open CMD.exe and run the batch from there, the output will show in that window, if you are unsure of the errors, then please post them here by [editing](https://stackoverflow.com/posts/46335928/edit) your question – Gerhard Sep 21 '17 at 05:58
  • Why do all of your `start`ing `exe`cutable paths begin with a back slash? – Compo Sep 21 '17 at 18:08
  • @Compo, because the directory they're in is in the root of the current drive? – Joey Mar 21 '18 at 06:52

0 Answers0