Sample script – Acronis Snap Deploy 4 - User Guide User Manual

Page 144

Advertising
background image

144

Copyright © Acronis International GmbH, 2002-2012

The images can be deployed to the corresponding target machines (p. 142).

Sample script

setlocal

SET IMG_PATH=\\image_server\images

SET TMP_DRV_LETTER=h:

net use %TMP_DRV_LETTER% %IMG_PATH%

echo off

for /f "tokens=1-13 delims= " %%a in ('ipconfig /all') do (

IF %%a EQU Physical (

for /f "tokens=1-3 delims= " %%a in ('echo %%l') do (

echo IMAGE FILE: %%a.tib

asdcmd.exe /create /filename:%TMP_DRV_LETTER%\%%a.tib /harddisk:1 /compression:8

goto end

)

)

)

:end

echo on

net use %TMP_DRV_LETTER% /d

wpeutil Reboot

endlocal

What this script does:
a)

Mounts the network folder

b)

Retrieves the booted machine’s MAC address

c)

Generates a .tib file name (if MAC address is 01-02-03-04-05-06 then the .tib file name will be 01-

02-03-04-05-06.tib)

d)

Creates an image of the volume C of the machine, and saves the image to the network folder

using the generated file name

e)

Restarts or shuts down the machine

Environment variables:

IMG_PATH: the path to a network folder on the deployment server.

TMP_DRV_LETTER: the mounted drive on target side.

Advertising