/build/static/layout/Breadcrumb_cap_w.png
07/19/2019 275 views

Hi,

I am running a simple script to re-register machines on our WSUS server.

The script fails when it tries to run the following command, saying that it cannot find the file specified:

                  C:\Windows\System32\wuauclt.exe /resetauthorization /detectnow

The file is present and the command can be run manually from the command line, but fails in the script?!?!

See screenshot of the commands in the script.  Any ideas on how to get this command to run?

9k=

Best Regards

Dave


Answer Summary:
0 Comments   [ + ] Show comments

Comments


Answer Chosen by the Author

2

change your directory to c:\windows\sysnative

Answered 07/19/2019 by: SMal.tmcc
Red Belt

  • my man
  • Thanks SMal.tmcc

    That worked when I ran the script against my own PC, however I had to change the path back to C:\Windows\System32 to get it to succeed on a remote PC.

    Looks like I can run the script successfully now.

    Dave
    • sysnative only applies to x64bit machines, is the remote an x86?
      • Correct again! Yes, the remote machine is an x86.

        Thanks for your help.
      • here is a good read on sysnative
        https://www.thewindowsclub.com/sysnative-folder-in-windows-64-bit

        you should create smart labels if you have not that are for x86 and x64 and use two scripts with those labels. You can also use a batch and a if then clause to tell what to use for either

        if exist c:\windows\syswow64 (C:\Windows\Systemnative\wuauclt.exe /resetauthorization /detectnow) else (C:\Windows\System32\wuauclt.exe /resetauthorization /detectnow)

All Answers

1

Which account are you running the script as?


wGCu+ZmSjqjAwAAAABJRU5ErkJggg==


I've had the same problem and had to run the script as something other than local system. Logged-in user or running from my admin account using credentials.

Answered 07/19/2019 by: feeldamped
Second Degree Blue Belt

  • Hi feeldamped,

    I'm running the script as the "Logged-in user"

    The simple commands like "net stop wuauserv" work just fine, but the script is failing when trying run "C:\Windows\System32\wuauclt.exe"