question

Teamcredext-2643 avatar image
0 Votes"
Teamcredext-2643 asked CandyLuo-MSFT answered

Windows 10: We wrote pwershell script and it has deleted Windows 10 system files

Windows 10 home single language

In powershell we wrote a program to backup the files and then delete those files. But somehow unknowingly we ran that script with admin rights and due to incorrect logic to calculate current directory. The script got executed on windows folder and has deleted many files

Now I cannot see start button, windows 10 graphics are weird, search box of windows in my PC is disappeared and many more problems

Any suggestions how can I recover the system

windows-10-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CandyLuo-MSFT avatar image
0 Votes"
CandyLuo-MSFT answered

Hi,

If windows system files are deleted accidently, you can try to run sfc /scannow to repair any corrupted or damaged Windows files. If they are found to be missing, it will replace the files.

If it still doesn't work, the recommend way is Reset This PC. Make sure your important data is safely backed up.

For your reference:

How to restore accidentally deleted system files in Windows 10

Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Best Regards,
Candy




If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.