How to Handle Unattended Script Execution for a Command with User Interaction?

0
8
Asked By CuriousCat99 On

I'm working on a script that uses UUPDUMP to create Windows ISOs in an unattended manner. The issue I'm facing is that the `uup_download_windows.cmd` script prompts me with an interactive message that says "press 0 or Q to exit," which means that my `Start-Process` command never completes. This causes the rest of my PowerShell script to hang, even though the ISO has been successfully downloaded and is ready.

I've thought about executing the command without waiting for it to finish and then checking for the existence of the ISO in a loop, along with validating its hash. However, I'm looking for alternative solutions that would allow me to continue past the `Start-Process -Wait` command when the external process requires some form of interaction. Any creative ideas?

3 Answers

Answered By DeploymentGuru56 On

Have you considered setting up a basic Microsoft Deployment Toolkit (MDT) task sequence? It allows for unattended operations and you can customize it to handle zero-touch deployments. It might work better for your diverse needs.

Answered By ByteWizard11 On

You can use input redirection to provide the necessary input to the script without waiting. Try creating a file named `input.txt` that contains a 'Q' followed by a carriage return. Then run the script like this: `uup_download_windows.cmd < input.txt`. This will simulate pressing 'Q' automatically.

Answered By TechSavvy88 On

One simple solution is to modify the CMD script itself so that it just exits with a success code instead of prompting for user input. This way, your script won't get stuck waiting for a response.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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