Page 1 of 1
[SOLVED] Post-installation script that runs every time the machine starts
Published: April 9, 2026 - 4:34 PM
by yannick.jolivet
Hello everyone , when I deploy my machines using WADS, I use a post-installation script. One of its actions is to rename the C drive to SYSTEM and create a D partition on the remaining disk space . I've noticed that the post-installation script runs every time the machine boots, even after the installation is complete. For example, if I rename my SYSTEM volume to TOTO, it will be renamed SYSTEM on the next reboot. For more details, I've inserted the script into the "right-hand" section of the configuration I apply to my PC. Is there an option I can configure to prevent this, or a best practice I might have missed? Thank you in advance
Re: Post-installation script that runs every time the machine starts
Published: April 9, 2026 - 4:45 PM
by sfonteneau
The script to launch is here
The last line of the script should normally be:
Code: Select all
"%windir%\system32\schtasks.exe" /Change /TN "SetupComplete" /Disable
Which disables the task itself.
So if it doesn't work, it's possible the script doesn't complete because it crashes beforehand
Re: Post-installation script that runs every time the machine starts
Published: April 10, 2026 - 1:29 PM
by yannick.jolivet
Hello
thank you for your reply.
It seems I've found the problem.
I tested the method of not writing the code directly in the right-hand side of the configuration, but importing it as a .cmd script.
However, to be able to import it directly, I had copied the script to the "C:\Program Files (x86)\wapt\templates\wads_template\windows\post_install" directory on the administration machine where the console is installed.
From that point on, the script only ran once.
To summarize, in the following two cases, the script ran continuously:
- Command lines written directly in the "script" section instead of being imported as a script
- Script located in a different location than the post_install directory described above (the script was located on a shared drive).
Re: Post-installation script that runs every time the machine starts
Published: April 10, 2026 - 3:35 PM
by yannick.jolivet
Hello again!
After looking into your reply, the problem actually stemmed from the fact that my script ended with the `exit` command,
so the task deactivation command never executed.
Thank you for your feedback.
Re: Post-installation script that runs every time the machine starts
Published: April 10, 2026 - 3:36 PM
by yannick.jolivet
We can therefore close this topic
Re: Post-installation script that runs every time the machine starts
Published: April 14, 2026 - 10:29 AM
by dcardon
Hi Yannick,
thanks for the feedback,
I'm marking the topic as resolved.
Denis