Advertisement
lincruste

Remote install with OS arch detection

Feb 6th, 2015
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. echo Batch pour installer IE11 (x86/AMD64) - MB. Technology Inc 2015 -
  3. rem requête de l'IP
  4. @SET /P adresse=[Entrez l'adresse IP du poste]
  5. rem Vérification de l'architecture de l'OS distant
  6. rem this one might have your curiosity
  7. for /f "delims== tokens=2"  %%a in ('wmic /node:%adresse% cpu get addresswidth /format:list^|find /i "addresswidth"') do (set arch=%%a)
  8. if %arch% == 64 (
  9.    pushd \\WINDOWS\SHARE\
  10. "\utils\PsExec.exe" \\%adresse% taskkill /f -im iexplore.exe
  11. "\utils\PsExec.exe" \\%adresse% -u domain\sammacountname -p password -i -c "\updates\IE11-Windows6.1-x64-fr-fr.exe"
  12. goto end
  13. ) else (
  14.     pushd \\WINDOWS\SHARE\
  15. "\utils\PsExec.exe" \\%adresse% taskkill /f -im iexplore.exe
  16. "\utils\PsExec.exe" \\%adresse% -u domain\sammacountname -p password -i -c "\updates\IE11-Windows6.1-x86-fr-fr.exe"
  17. goto end
  18. )
  19. :end
  20. popd
  21. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement