RedPlug's Tory

Active Directory Group Policy 내 사용자 그룹 정책(Logon정책)으로 배포하기 위한 스크립트 샘플

@echo off
title Program install chk.
 
echo Windows 10 Check
ver | find "10.0" > nul
if %ERRORLEVEL% == 0 goto start
 
goto end
:start
 
echo Program Install chk
IF NOT EXIST "C:\Program Files\Program\redplug\redplug.exe" (
   GOTO :filecopy
) ELSE (
   del C:\ProgramData\setup64.exe
   rd c:\ProgramData\ProgramInstall
   GOTO :end
)
 
:filecopy
echo Program file copy
IF EXIST c:\ProgramData\ProgramInstall\setup64.exe GOTO :install
md c:\ProgramData\ProgramInstall
 
copy \\filesever\redplug\setup64.exe c:\ProgramData\ProgramInstall
 
:install
echo Program file copy OK
call c:\ProgramData\ProgramInstall\setup64.exe /s /v"/qb"
 
:end
@echo success
echo Program chk end

필요한경우 bits를 이용해 http로도 다운로드를 변경해서 사용이 가능

bitsadmin.exe /transfer "Filedownload" http://downloadsite.com/downloadfile.exe c:\ProgramData\ProgramInstall\downloadfile.exe