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

Run PowerShell as Admin #30

Closed
SCHEFFRA opened this issue Jul 3, 2024 · 4 comments
Closed

Run PowerShell as Admin #30

SCHEFFRA opened this issue Jul 3, 2024 · 4 comments

Comments

@SCHEFFRA
Copy link

SCHEFFRA commented Jul 3, 2024

Seems that the Powershell script "LAUNCH-CTT-WINUTIL.ps1" has to be executed with admin permission, so it would be helpfull to integrate also the right click option like "run with powershell (admin)"

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)]
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)\Command]
@=""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-Command" ""& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \"%1\"' -Verb RunAs}""

@memstechtips
Copy link
Owner

Thank you so much for this! Now I don't have to go and search for it.

Will test it out in the development branch and add to main if it works.

@ViwuAndYouKnow
Copy link

ViwuAndYouKnow commented Jul 4, 2024

I have created a different method using cmd, took me some time to get it working, it gives an error when ran but it will still launch the software without the need of looking for powershell at all. Enjoy :)

"# Creates Desktop Shortcut for the Chris Titus Windows Utility So You Can Easily Launch it to Install Programs
$path = "C:\Users\Default\Desktop\Launch-CTT-WinUtil.bat"
$content = '@echo off & net session >nul 2>&1 || powershell -Command "Start-Process "cmd.exe" -ArgumentList "/c %~f0" -Verb RunAs" && exit /B & powershell.exe -Command "iex (iwr "https://www.christitus.com/win\")"'
[System.IO.File]::WriteAllText($path, $content, [System.Text.Encoding]::UTF8)

Update: found a fix for the error and boon issue, pull request created.

@Spomsoree
Copy link

A text file with a short how to, on how to run iwr -useb https://christitus.com/win | iex would be cool too.

@memstechtips
Copy link
Owner

Thanks for all the contributions and ideas, it's now fixed in a9348a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants