How can I validate that the PCT Package I created is valid and not corrupt?
As a general rule, every package that is created should be checked for corruption. This saves the user a headache in the long run because it will prevent data loss and attempts at data recovery. If a package is validated when it is first created, then the user knows that the source computer can be imaged since all the necessary data is located in the package, and it is usable.
You can manually run the Package content tool (pkgcntnt.exe) with the –validate switch by running the following in a batch script:
@ECHO OFFThis, however, requires a user to decide what to do based upon the return code displayed.
ECHO Validating personality package
"location of pkgcntnt.exe" -pkg:"location of the package.exe" -validate
ECHO Return Code: %errorlevel%
See the bottom of this article for the list of return codes.
If you are automating you personality migration through Deployment Server you can use this same tool in a script task. This is extremely helpful if you are re-imaging the machine after personality capture.
In your migration job, add a run script task. In the Run this script window, use the following:
"location of pkgcntnt.exe" -pkg:"location of the package.exe" -validateYou will probably want to use tokens for the package name so this will work on any machine it is run. You can set this to run on the client machine or locally on the Deployment Server.
Unless you change the defaults for return codes, when this script runs, if it returns anything other than 0 (success) the job will stop.
|1||The package provided is not a valid PC Transplant package|
|2||There was an error creating the logfile. Please check the name and try again|
|3||You must provide a PC Transplant package for PkgContents to run properly|
|4||There was an error opening the PC Transplant package provided|
|5||The password provided did not match the "Edit" password stored in the PC Transplant package|
|6||There was an error decrypting the password provided|
|10022||The package name provided appears to be corrupt. Please make sure the file is a valid PCT migration package|
One cause of the error 10022 may be that there are problems with the input of the script. If there are spaces in the file paths for any of the above, they must be in quotation marks. You should put quotation marks around all pathnames just for good practice.
(not avaliable prior to PCT 6.0)
|-?||Display the list of command line options for PkgContents|
|-q||Run PkgContents in quiet mode|
|-pkg:<package name>||Allows you to specify the name of the package to use. Requires quotation markes if there are spaces in the name|
|-log:<log file>||Allows you to specify the name of the log file|
|-content:<1, 2 or 3>||Allows you to specify which items to generate in the log file
|-pwd:<password>||Allows you to pass in the edit password for a valid PCT package. If password is encrypted, -decryptpwd must also be supplied|
|-decryptpwd||Should be used only when supplying a password that has been encrypted. Should only be used in conjunction with -pwd command line switch|
|-validate||Allows you to validate the index and files in a PC Transplant package. This switch must be used in conjunction with the -pkg switch|
If you have any further questions regarding this tool or corrupt PCT packages, please contact Altiris Technical Support.