Page 1 of 1

run

Published: March 17, 2017 - 09:50
by gaelds
I use the following command in one of my packages

Code: Select all

run_notfatal(r'wuauclt.exe /resetauthorization /detectnow')
But I get the following message:
Warning: Command 'wuauclt.exe /resetauthorization /detectnow' returned non-zero exit status 1.
Output: 'wuauclt.exe' is not recognized as an internal or external command, executable program or batch file.
However, I can run this command manually on the machine; I haven't found an explanation in the Wapt documentation...

Re: run

Published: March 17, 2017 - 9:46 PM
by sfonteneau
The path to system32 needs to be specified

Code: Select all

run( '"%s" /resetauthorization /detectnow' % makepath(system32,'wuauclt.exe') )

Re: run

Published: March 22, 2017 - 3:44 PM
by gaelds
Sorry, but I'm still getting the following error with this last command:
Warning: Command '"C:\\Windows\\system32\\wuauclt.exe" /resetauthorization /detectnow' returned non-zero exit status 1.
Output: "C:\\Windows\\system32\\wuauclt.exe" is not recognized as an internal or external command, operable program or batch file.

Re: run

Published: March 22, 2017 - 3:56 PM
by htouvet
Likely a 32-64 bit redirection problem because wapt is 32-bit so Windows makes a "transparent" rewrite of certain paths to show the wapt process a 32-bit type system.

To disable this redirection:

Code: Select all

with disable_file_system_redirection():
    run( '"%s" /resetauthorization /detectnow' % makepath(system32,'wuauclt.exe') )

Re: run

Published: March 23, 2017 - 11:50 AM
by gaelds
Yes, it works well with the disable_file_system_redirection instruction, thank you!