Custom Post-Imaging Actions (PSImage)

PSImage is not supported by FileWave Support so please do not submit tickets with them about it. The information provided here is for educational purposes only. If you would like to purchase professional services hours for consulting assistance setting up PSImage or customizing it please contact with your request. If you have existing unused professional services hours you may be able to use them for this purpose. Any feedback on PSImage can also be sent to the same email address. Any work on this would be done on Discord or in working with Professional Services. For the official Windows Imaging solution please see Network Imaging / IVS.

PSimage includes a mechanism for you to add post-imaging actions to the imaging workflow. These are executed by the to_do.bat file in the scripts folder of the psimage share and run with admin privileges under the context of the temporary local fwadmin account. This account is deleted at the end of the post-imaging phase. Custom post-imaging actions are enabled via 2 mechanisms:

  1. The contents of the extra folder in the psimage share is copied to c:\windows\temp\psimage. Place any files/folders here that you want to be copied to the reimaged PC and run during the post-imaging phase. The c:\windows\temp\psimage folder will be deleted automatically from the reimaged PC at the end of the post-imaging phase.
  2. Use the to_do.bat file in the scripts folder of the psimage share to trigger any built-in Windows utilities or executables/installers that have been copied to c:\windows\temp\psimage. Note that the post-imaging phase does not have access to the the psimage share but only to the files copied to c:\windows\temp\psimage. If there are any commands that must be run or apps that must be installed immediately ASAP after reimaging, add them to the extra folder and trigger them via to_do.bat as necessary.

Please take note of the tips outlined in the sample to_do.bat for how to trigger apps. There is a reboot at the end of the post-imaging phase so be sure to launch executables with "start /wait", particularly installers, so that the to_do.bat waits for them to finish before moving on to the next item in the script. Otherwise the system might reboot prematurely before your executable/installer has had a chance to finish running. If you need to deploy files to the hard disk of the reimaged PC, either include them in the disk image or copy them from c:\windows\temp\psimage, but do not move them as explained in the to_do.bat file.

REM Copy files from psimage folder to their intended locations instead of moving them so they inherit security
REM permission from the existing parent folder. Otherwise the owner will be system account and no users will be able to
REM access the files.
REM If adding registry settings with reg add with a value that includes spaces and double quotes in it, add 
REM outer quotes (to maintain the spaces) and backslash escape the inner quotes to maintain them in the registry
REM value.
REM reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v bginfo /t REG_SZ /d "\"C:\Program Files\bginfo\Bginfo64.exe\" \"C:\Program Files\bginfo\config.bgi\" /timer:0 /silent /nolicprompt"
REM If launching an executable use start /wait so the script waits for your binary to finish before rebooting. 
REM If the commandline includes spaces use start /wait "" <your_command_line>.
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S
REM For logging redirect the output for your commands with >> c:\windows\temp\psimage.log
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S >> c:\windows\temp\psimage.log
REM To redirect both stderr and stdout for your commands use >> c:\windows\temp\psimage.log 2>&1
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S >> c:\windows\temp\psimage.log 2>&1

echo Running to_do.bat >> c:\windows\temp\psimage.log

Revision #6
Created 21 July 2023 15:55:30 by Josh Levitsky
Updated 21 July 2023 16:34:22 by Josh Levitsky