Help Creating Fix All Script In PS

Page 3 of 4 FirstFirst 1234 LastLast

  1. Posts : 7,606
    Windows 10 Home 20H2
       #21

    CMD /C GPupdate worked from Windows PowerShell.

    Help Creating Fix All Script In PS-annotation-2022-02-28-234704.jpg
      My Computer


  2. Posts : 194
    Windows 10
    Thread Starter
       #22

    Matthew Wai said:
    I got the same problem.

    Attachment 361019

    Should the command be GPUpdate -Force?
    The command in cmd prompt is gpupdate /force.
      My Computer


  3. Posts : 7,606
    Windows 10 Home 20H2
       #23

    Have you noticed my last post above?
      My Computer


  4. Posts : 194
    Windows 10
    Thread Starter
       #24

    Whoops! I missed it.

    Looks like that worked.


    Help Creating Fix All Script In PS-image.png

    Now how do I get it so that the user doesn't have to press anything to continue?
      My Computer


  5. Posts : 16,956
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #25

    SightUp,

    I can see that you are putting a lot of thought into this but do consider what you are actually achieving.
    At the very least, I would suggest that the name "Fix all" script is inappropriate.

    Best of luck,
    Denis
      My Computer


  6. Posts : 7,606
    Windows 10 Home 20H2
       #26

    SightUp said:
    the user doesn't have to press anything to continue?
    Remove this command: Read-Host -Prompt 'Press any key to continue'
      My Computer


  7. Posts : 194
    Windows 10
    Thread Starter
       #27

    Matthew Wai said:
    Remove this command: Read-Host -Prompt 'Press any key to continue'
    Help Creating Fix All Script In PS-image.png

    This is what it is now. That command isn't there.
      My Computer


  8. Posts : 7,606
    Windows 10 Home 20H2
       #28

    The command Pause requires someone to press "Enter".
      My Computer


  9. Posts : 2,800
    Windows 7 Pro
       #29

    Code:
    &sfc /scannow
    start-sleep 5
    &GPUpdate /Force
    start-sleep 30
    restart-computer
      My Computers


  10. Posts : 7,606
    Windows 10 Home 20H2
       #30

    They can simply be combined into a single line:

    sfc /scannow;start-sleep 5;CMD /C GPupdate;start-sleep 30;restart-computer
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:41.
Find Us




Windows 10 Forums