Skip to content

Script/Command to quit task sequence

Featured Replies

Hi All

 

I have written a nice little HTA that will gather all the info in one screen, then I can click my "launch" button and it will build the machine, no problem. What I would like to do is insert a canel/abort button in the case that the technician wants to cancel the build. Do you know the code that can perform this function?

 

Something worth noting is that obviously the Task Sequence has already begun, so is thre any point in cancelling it at this stage or have I gone too far? It may still be workable, but I may have to delet some directories form the C: drive. My launcher/HTA is the first item in the TS, so no formatting has happened at this stage.

 

Thanks

Con

You can do that by defining a variable in your script and give it a value of FALSE. On your cancel button just perform a self.close(). On the OK button action set the varibale to TRUE.

Group everything behind the HTA in your task sequence and run this section only when the variable is TRUE.

This way you don't have to care about leftovers on your hard disk.

  • Author

That's a great idea. Nice and simple too. I'll give it a go and let you know how it works.

 

Thanks

Con

  • Author

Thanks Peter33

 

That was a great idea and it worked like a charm.

 

Con

  • 12 years later...
On 10/22/2012 at 1:09 PM, Peter33 said:

You can do that by defining a variable in your script and give it a value of FALSE. On your cancel button just perform a self.close(). On the OK button action set the varibale to TRUE.

Group everything behind the HTA in your task sequence and run this section only when the variable is TRUE.

This way you don't have to care about leftovers on your hard disk.

Hi, unless I am doing something wrong, and even though I am using a wpf, the concept is the same. I have the  $Form.Close() behind mu button, but it only closed the form not stop or cancel the task sequence. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.