Menu
CCMEXEC.COM – Enterprise Mobility
  • Home
  • General
  • Configuration Manager
  • Windows 10
  • Windows 11
  • Intune
  • GitHub
  • About
CCMEXEC.COM – Enterprise Mobility

Allow the user to postpone installation in SCCM

Posted on September 13, 2011 by Jörgen Nilsson

I have used this script many times now in many different versions and I thought it was time to share an example on what can be achieved with a vbscript. It can be used to display information to the user and let the used postpone the Installation/Upgrade a number of times, check for running processes and more.

The following features exist in this example and can be seen as an example on what can be done, so adjust it to fill your needs. A HTA to display more information is one example of an enhancement, adding more processes to check another.

The script is run using the “Run this program before” feature and can be used both for Programs and for Task Sequences.

Functions:

  • Prompt the user that an installation/upgrade is about to be performed.
  • Allow the user to postpone the installation/upgrade of an application x amount of times. If the user postpones the installation the script will return exit code 1 and SCCM will assume it failed and not continue depending program or task sequence.
  • After x amount of times postponed the script will start the installation anyway.
  • Countdown timer
  • Check that the process specified is closed if not prompt the user to close it.

Screenshots of how it will look at the client:

prerun3

If the user press Cancel:

prerun4

If the Process specified is running:

prerun5

Usage:

  • Download the script: https://ccmexec.com/wp-content/uploads/2011/09/Prerun1.txt
  • Create a Package in SCCM containing the prerun1.vbs file
  • Create a Program with a command line for executing the script, for example:
    “wscript.exe prerun1.vbs Excel Excel.exe”
  • Configure the settings under environment according to the example below.

prerun1

  • For the Application you want to use it to install configure it to run the Prerun1 program before like this:prerun2
  • Then advertise it as you normally would and try it out!

I hope this can has showed a new example of what can be done using Configuration Manager and a little bit of scripting.

12 thoughts on “Allow the user to postpone installation in SCCM”

  1. Rafal says:
    September 13, 2011 at 10:24 pm

    Hey ,

    I did similar thing , but I have written it in VS 2010. Basically user can install immediately or press postpone. It displays 60 min and counting down timer. When user postpone it minimize to tray and then pop up automatically 5 minutes before deadline.

    Reply
  2. Pingback: Allow the user to postpone installation in SCCM « MS Tech BLOG
  3. Ray says:
    September 22, 2011 at 4:31 am

    I have a friend going through this, I email him. Thanks for posting this!

    Reply
  4. Wayne Rossetto says:
    October 14, 2011 at 9:34 pm

    Great work thank you. I have come across a problem however, It works fine with just one application string i.e. word winword.exe but if you use multiples i.e. word excel outlook winword.exe excel.exe outlook.exe it just exits and I can’t see why. This is important as otherwise the user will get prompted each time you run the check for each single application. I see you allow up to 5 processes to be examined. Any feedback to resolve this would be greatly appreciated.

    Reply
  5. Stian says:
    October 26, 2011 at 1:22 pm

    Hi, this is brilliant, but i have tried it in my test enviroment, and if i click Cancel 3 times, it just report FAILED in the sccm logs, and the application do not install…

    I have i the advertisemenr the following schedule:
    Run as soon as possible
    Occurs on 26.10.2011 12:00
    Occurs on 26.10.2011 12:15

    Reply
  6. Jörgen Nilsson says:
    November 16, 2011 at 7:37 am

    @ Wayner Resetto: I will post an update with support for more command-lines than one.
    @Stian: Which advertisement failed? the script or the depending application?

    /Jörgen

    Reply
  7. David says:
    August 9, 2012 at 4:02 pm

    Hi Jörgen,
    I am having an issue getting a VB script to work in either the run program before option or in a TS. I have tried your method listed above and tried some methods using serviceui.exe. I am not sure if its my script/hta or I am missing a step. I am trying to do a sql 2008 mgmt studio deployment and need to deploy windows framework/powershell and windows installer first. After these 2 install, I need to prompt the user that they need to save their work and hit ok to restart. If I run the script in a program by itself it works, but not when I If you have time I can send you the script and more details on how I set up the TS and programs.

    Thanks!

    Reply
  8. Chris Morrow says:
    March 19, 2013 at 8:25 pm

    Hi,
    I’ve tried using your program because it is an addition to the SCCM toolkit that I want to use to allow users a bit more flexibility in installing programs and making sure that processes aren’t running that might block the install. I’ve tested to make sure the script works on it’s own without any errors. When I setup the Check Excel program the way shown, I can not choose to use in a task sequence as it’s own program, which I believe is because of the setting to “Allow users interaction with the program”. So, I believe as shown, the only way to use this is with an Advertised Program, not an Advertised Task Sequence.

    I’m getting a SCCM error (80008013 which indicates the task to run before may/may not have been successful, SCCM can’t tell) when I try to use it as a task to run before the install (as shown above). I am testing pushing out an application install using a Task Sequence and the prompt does not come up as shown. I was hoping to use a Task Sequence to test with this because I usually use Task Sequences to install software because of customizations and because it shows a progress bar to the user. As far as I am aware, if the checkbox “Allow users to interact with this program” is checked for Check Excel, then this Package/Program is not available to be used in a Task Sequence.

    Thanks for any help you may give here…
    Chris

    Reply
  9. Sean Lillis says:
    August 31, 2013 at 1:49 pm

    Hi Jörgen,

    I hope you don’t mind me shamelessly plugging the Powershell App Deployment Toolkit here, because I think anyone who is interested in the functionality your script provides will want to check it out. It does everything your script can do plus a whole lot more with lots of configurable options to prompt users to close apps, prevent apps from being launched during install, defer X number of times, x number of days or until deadline is reached, countdown to automatic closing of apps, etc. It plays nicely with SCCM and makes use of fast retry codes for deferrals. Also, it has a nice UI that can be branded with a corporate logo/banner, the text is customizable in XML and is localised in several languages.

    You can download the tool here: http://psappdeploytoolkit.codeplex.com

    Thanks, Seán

    Reply
  10. Paul says:
    May 7, 2014 at 4:13 pm

    Is there a way to have it check for a process other than the one that is being installed and to correctly prompt the user? For example, what if I’m installing Flash and I need to see if Internet Explorer is running. If I configure the command like “wscript.exe prerun1.vbs Flash iexplore.exe” It’s going to tell the user Flash is being upgraded and then if IE is open, it’s going to tell it to close Flash, which is incorrect. If you change it to “wscript.exe prerun1.vbs Internet Explorer iexplore.exe” it’s going to tell the user Internet Explorer is being upgraded, which is also incorrect. What it needs to do is Say Flash is being upgraded, give the user the option to say OK or postpone and then if Internet Explorer is open it detects it and then tells the user they need to close Internet Explorer. Hopefully that makes sense.

    Reply
  11. Hichem says:
    May 27, 2014 at 10:58 am

    Is it possible to use it in a task Sequence??

    Reply
    1. Jörgen Nilsson says:
      June 13, 2014 at 12:01 pm

      Hi,
      Yes, you can use it in a task sequence with the use of ServiceUI.exe or as a pre-run command to the task sequence.
      /Jörgen

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • New settings in Intune Security Baseline Windows 11 24H2 -2504
  • Managing extensions in Visual Studio Code
  • Reinstall a required Win32app using remediation on demand
  • Administrator protection in Windows 11 – First look
  • Remediation on demand script – ResetWindowsUpdate
©2025 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT