How I can add this codes like script
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts"How I can add this codes like script
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts"Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Muhammad Imran AnsariPosted Mar 24, 2025, 5:43 AM
Hello Amr,
You can add this PowerShell command as a script by saving it in a
.ps1file. Here's how:Steps:
.ps1file, e.g.,CreateRegistryKey.ps1.cd(e.g.,cd C:\Scripts).5. If you need to bypass execution policy, run:
6. If you need to bypass execution policy, run:
Good Luck!
Amira BedhiafiPosted Mar 23, 2025, 10:00 PM
Open Notepad or any text editor and paste your code :
Save the file with a
.ps1extension and go to the folder where the script is saved and run it :