#How can I execute an .exe file and accept all requirements?

26 messages · Page 1 of 1 (latest)

quaint rock
#

So I'm trying to write a script which updates the hp bios version of a device, could someone tell me how I can start the .exe and accept everything needed without having to run it manually?

winter mica
#

please refer to the documentation or help for the exe

quaint rock
winter mica
#

you need to find / read it. There's no rules for exe's. They're all dirty snowflakes using whatever rules whoever wrote it dreamt up.

There's really not much PS can do to help you here.

#

if it's a public thing, I'd check and see if chocolatey has a package for it. If it does, that package will likely reveal and silent arguments

#

there's a couple of websites that document silent args for things too that are worth a shot

quaint rock
#

I got told there'd be an option called -AcceptLicense, though that's not working.

winter mica
#

yep, but that just loops back to "you need docs"

#

sys internals has a Strings utility which can be used to attempt to search an exe for arguments. But it's basically just scraping the file looking for embedded strings of a certain length

quaint rock
#

it's not :(

winter mica
#

this is, unfortunately, one of the perils of trying to package stuff

#

it literally just tries to find stuff that might be a command line argument

quaint rock
#

So when I executed it manually I had to accept the license and stuff and THEN the computer restarted as it should've.
Though the script should execute the .exe

winter mica
#

yes, but the script can't just magic the GUI clicky requirement away

quaint rock
#

and that's what I'm trying to do, that it clicks through the GUI but the user doesn't see it when executing it.

winter mica
#

then you need to find the silent args, if it has any. If it doesn't you can look at Auto-Hot Key perhaps

quaint rock
#

alright, I'll look it up.

#

So you can press keys via the script?

#

like tell the script to type something

winter mica
#

not trivially, no

#

PS is not a UI automation language. You can try SendKeys, but it's quite basic

#

ofc it would be far better to not have to deal with the prompt at all, so silent args if you can find them

quaint rock
#

got it working :D