Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to get administrator privilege #55

Closed
h26v opened this issue Dec 31, 2023 · 4 comments
Closed

Fail to get administrator privilege #55

h26v opened this issue Dec 31, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@h26v
Copy link

h26v commented Dec 31, 2023

Describe the bug
I use this code to get administrator privilege

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if "%errorlevel%" NEQ "0" (
	echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
	echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
	"%temp%\getadmin.vbs" &	exit
)

But the window pops up for about 3 seconds then disappears

@h26v h26v added the bug Something isn't working label Dec 31, 2023
Copy link

If you need fast help join the server https://discord.gg/qvkC6kHqer

@KingKDot
Copy link
Owner

Describe the bug

I use this code to get administrator privilege


>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if "%errorlevel%" NEQ "0" (

	echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"

	echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

	"%temp%\getadmin.vbs" &	exit

)

But the window pops up for about 3 seconds then disappears

I'll take a look. For the time being I recommend you using powershell runas command which I know works.

@KingKDot
Copy link
Owner

Also using powershell will allow you to not need to make a temp file

@h26v
Copy link
Author

h26v commented Jan 1, 2024

Alright, I will try it, thanks for you supporting

@h26v h26v closed this as completed Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants