Author Topic: Simple run  (Read 70 times)

Rookie56

  • Newbie
  • *
  • Posts: 2
Simple run
« on: May 31, 2018, 06:53:12 am »
In Windows 10, there is the command to trigger Windows Update Check for update as usoclient.exe startscan
I did simple run("usoclient.exe"," startscan") , I have error 1932 WinExec: Function Failed.
I also did
coms=environment("COMSPEC")
runhidewait(coms, "/c usoclient.exe startscan")  but it still does not work.
Please help

td

  • Tech Support
  • *****
  • Posts: 2463
    • WinBatch
Re: Simple run
« Reply #1 on: May 31, 2018, 08:40:08 am »
UsoClient.exe is a replacement for wuauclt on Windows 10.  It does not have a 32-bit version on 64-bit Windows so that is one reason it will not start by simply using the 32-bit Run function with the exe's name. 

If you had clicked on the More Error Info button that displayed on the error message dialog, you would have likely found that Run could not find the file 'UsoClient.exe'  It could not find it because of file redirection.  File redirection has been a part of 64-bit Windows for about 12 years so it is well understood and you can read more about it as it relates to WinBatch here:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/64-bit+File~Redirection.txt

Also keep in mind that UsoClient.exe does not have a UI.  MSFT doesn't seem too interested in documenting it either.  I haven't spent any time trying to learn much about what actually happens when it is executed other than it seems to kick off one or more background update services.  It requires elevated admin privileges, as well.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


Rookie56

  • Newbie
  • *
  • Posts: 2
Re: Simple run
« Reply #2 on: May 31, 2018, 11:14:46 am »
Thank you