How I can add this codes like script
Code
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amira BedhiafiRank #601 · 4K reputationPosted Mar 23, 2025, 6:00 PM EDT
Open Notepad or any text editor and paste your code :
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts"Save the file with a
.ps1extension and go to the folder where the script is saved and run it :Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Mar 24, 2025, 1:43 AM EDT
Hello Amr,
You can add this PowerShell command as a script by saving it in a
.ps1file. Here's how:Steps:
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts" -Force.ps1file, e.g.,CreateRegistryKey.ps1.cd(e.g.,cd C:\Scripts).Set-ExecutionPolicy RemoteSigned -Scope Process .\CreateRegistryKey.ps15. If you need to bypass execution policy, run:
6. If you need to bypass execution policy, run:
powershell -ExecutionPolicy Bypass -File "C:\Path\To\YourScript.ps1"Good Luck!