Create Powershell 7 Shortcut in Windows 11 To Run SFC /SCANNOW

Discussion in 'other software & services' started by TerryWood, Feb 18, 2025.

  1. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,089
    Hello to Wilders Experts

    A simple request (I cannot find out how to do it)

    I want to put a Powershell 7 shortcut on my desktop that will run sfc /scannow. A single click plus User Account Control YES.

    I don't want to use CMD.
    I don't want to type in sfc /scannow each time I use it.

    I have searched high and low for a solution - no joy. I can achieve the same objective i Windows Power Shell but not version Powershell 7.5

    Can anyone help please?

    Thank you.

    Terry
     
  2. stapp

    stapp Global Moderator

    Joined:
    Jan 12, 2006
    Posts:
    27,161
    Location:
    UK
  3. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,089
    Hi Stapp

    Many thanks for your input. I had already found and tried Shortcut 1 and it works on the standard version but not on Powershell 7.5 version 7.5 for some reason. I'm going to have another go today.

    Terry
     
  4. The Seeker

    The Seeker Registered Member

    Joined:
    Oct 24, 2005
    Posts:
    1,349
    Location:
    Adelaide
    The below is from Copilot.
    This script will open a command prompt with elevated permissions and run the sfc /scannow command. Make sure to save it with a .ps1 extension and run it as an administrator.
     
  5. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,089
    Hi @ The Seeker

    Thanks for your help.

    It doesn't work on my Windows 11 PC. I saved it as a PS1 extension. When I clicked on it, it just opened it as a file it doesn't start the sfc /scannow process.

    Terry
     
  6. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,089
    Hi @ The Seeker

    Maybe it's this that caused it not to work:-

    "Windows 11 does not allow a PowerShell script to initially run as Windows 10 did. We generally receive this issue when running the PowerShell scripts for installing Microsoft Office. You will need to use the following instructions to run a PowerShell script in Windows 11...."

    Terry
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.