-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathLogonAutostartExecutionStartupFolder.ps1
More file actions
29 lines (21 loc) · 1.26 KB
/
LogonAutostartExecutionStartupFolder.ps1
File metadata and controls
29 lines (21 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$global:version = "1.0.0"
$ascii = @"
.____ .__ .____ ___. _________ __
| | ____ ____ _____ | | | | _____ \_ |__ / _____/ _____/ |_ __ ________
| | / _ \_/ ___\\__ \ | | ______ | | \__ \ | __ \ \_____ \_/ __ \ __\ | \____ \
| |__( <_> ) \___ / __ \| |__ /_____/ | |___ / __ \| \_\ \/ \ ___/| | | | / |_> >
|_______ \____/ \___ >____ /____/ |_______ (____ /___ /_______ /\___ >__| |____/| __/
\/ \/ \/ \/ \/ \/ \/ \/ |__|
~ Created with <3 by @nickvourd
~ Version: $global:version
~ Type: LogonAutostartExecutionStartupFolder
"@
Write-Host $ascii`n
# Set the path for the NickvourdSrv folder
$folderPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
# Add permission for all built-in users to FullControl to the Startup folder
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Users", "FullControl", "Allow")
$acl = Get-Acl $folderPath
$acl.SetAccessRule($rule)
Set-Acl -Path $folderPath -AclObject $acl
Write-Host "`n[+] Permission has been granted to all built-in users to full control to $folderPath`n"