The savestat.cmd utility allows you to store and retrieve up to 21 values to persistent storage.
You can use the savestat utility to return to your place in an installation, even when a reboot is required. This utility is designed to return values that set the errorlevel environment variable so that you can branch in a script or batch file based on the result of the utility's execution.
The utility runs in 32- and 64bit versions of Windows Preinstallation Environment 2.1/3.0, Windows Server 2003, and Windows Server 2008.
The savestat utility command-line syntax:
SAVESTAT [/q] /reset SAVESTAT [/q] /set1=value [.../set2=value ... /set21=value] SAVESTAT [/q] /getn SAVESTAT [/q] /validate SAVESTAT [/q] /signature
The savestat utility uses these parameters.
Parameter | Description | Usage |
---|---|---|
/setn=value |
Saves an integer value, value,
to the th location in persistent-storage memory,
where n is an integer from 121 Return
codes:
|
savestat /setn=value Where:
|
/getn |
Retrieves the value currently set in the nth
location in persistent-storage memory, where n is an integer
from 1-21. Return codes:
|
savestat /getn Where n is an integer from 121 |
/reset |
Resets all persistent-storage memory to values
of zero. Return codes:
|
savestat /reset |
/signature |
Verifies that the persistent storage contains the savestat signature. Return
codes:
|
savestat /signature |
/validate |
Verifies that the system is supported by savestat. Return
codes:
|
savestat /validate |
/q |
Invokes the quiet mode. This parameter is optional and can be used with any other savestat parameter. | savestat /q /set1=100 |
Example | Description |
---|---|
savestat /set2=100 |
Stores the value 100 in the second persistent-storage memory location |
savestat /get2 if errorlevel 100 goto end if errorlevel 1 goto level1 :level1 call level1.bat :end |
Retrieves the value of the second persistent-storage memory location and branches in the batch file according to the value returned |