Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- SETLOCAL EnableDelayedExpansion
- for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
- set "DEL=%%a"
- )
- echo Batch d'installation de polices a distance - MB. Technology Inc 2015 -
- call :ColorText 0E "_______________________________________________________________________________"
- echo(
- echo(
- call :ColorText 0F " GLISSER LES POLICES A INSTALLER SUR"
- call :ColorText 0C " L'ICONE "
- call :ColorText 0F " DU BATCH AVANT EXECUTION"
- echo(
- call :ColorText 0E "_______________________________________________________________________________"
- echo(
- echo(
- SET /P adresse=[IP de la machine distante]
- IF [%1] EQU [] echo(&echo Pas de police a installer&echo Glissez directement les polices sur l'icone du batch&echo Ne PAS double-cliquer pour l'executer&echo( &goto end
- FOR %%A IN (%*) DO xcopy /i /s /y %%A "\\%adresse%\c$\temp\fonts\"
- rem Vérification de l'architecture de l'OS distant
- for /f "delims== tokens=2" %%a in ('wmic /node:%adresse% cpu get addresswidth /format:list^|find /i "addresswidth"') do (set arch=%%a)
- if %arch% == 64 (
- xcopy /i /s /y "\\serveur\public\Freewares\Utils_system\fontreg-2.1.3\bin.x86-64\FontReg.exe" "\\%adresse%\c$\temp\fonts\"
- goto fontreg
- ) else (
- xcopy /i /s /y "\\serveur\public\Freewares\Utils_system\fontreg-2.1.3\bin.x86-32\FontReg.exe" "\\%adresse%\c$\temp\fonts\"
- goto fontreg
- )
- :fontreg
- rem exécution distante de fontreg (copie des polices dans %windir%\fonts et enregistrement dans la base de registre)
- \\serveur\assistance\public\Freewares\Utils_system\Sysinternals\PsExec.exe /accepteula \\%adresse% cmd /c (pushd c:\temp\fonts ^& fontreg.exe /copy)
- goto end
- :end
- pause
- goto :eof
- :ColorText
- echo off
- <nul set /p ".=%DEL%" > "%~2"
- findstr /v /a:%1 /R "^$" "%~2" nul
- del "%~2" > nul 2>&1
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement