• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

How do I become admin in powershell?

Yeah I got that now its licking its arse and having a cleanup.

Will I have to redo the Macrium as I've not done this first?

That bit is done.
 
Hi,
Only good thing power shell is good for is removing or installing apps
 
Wrong. It's better every way, very powerful and even better than Bash. Not talking about command line interface itself, which is steadily best out there.
But copy and paste works well
He will not learn anything if just copypasting.
 
Mate this is beyond me by fucking universes...
 
Hi,
Don't worry about it
Paste all of those strings in notepad and save it to use later.
 
Hi,
Do not use power shell
Use command prompt as admin instead

One line at a time

Code:
sfc /scannow

DISM /Online /Cleanup-Image /AnalyzeComponentStore

DISM /Online /Cleanup-Image /StartComponentCleanup


DISM /Online /Cleanup-Image /CheckHealth

DISM /Online /Cleanup-Image /ScanHealth

DISM /Online /Cleanup-Image /RestoreHealth
I would not run sfc /scannow first. It would be the last. Also, like I said doing checkhealth and scanhealth takes much longer than just restoring health. So I just skip those and go straight to just restorehealth. ;)
 
I would not run sfc /scannow first. It would be the last. Also, like I said doing checkhealth and scanhealth takes much longer than just restoring health. So I just skip those and go straight to just restorehealth. ;)
Hi,
I'd usually just use verifyonly
But only reason to do the other deeper strings is if scannow finds and can't fix or finds errors period.
Then I'd do the rest.
 
I've found this little gem, it's called GSUDO. And yes, it works just like you would think it works like.
GitHub - gerardog/gsudo: A Sudo for Windows

Take any command and prepend it with the command "sudo" and boom, the command is automatically elevated much like sudo on Linux works like. You can even change the settings of it so that it doesn't ask do a UAC prompt every time you invoke the "sudo" command for a period of five minutes.
 
Hi,
Do not use power shell
Use command prompt as admin instead
You can feed to cmd with current elevation rights with &cmd.exe in psh.

Just an example here from my terminal.

Code:
&cmd.exe /c rd /s /q .\5A894077.McAfeeSecurity_2.1.68.0_neutral_split.scale-100_wafk5atnkzcwy\
 
You can feed to cmd with current elevation rights with &cmd.exe in psh.

Just an example here from my terminal.

Code:
&cmd.exe /c rd /s /q .\5A894077.McAfeeSecurity_2.1.68.0_neutral_split.scale-100_wafk5atnkzcwy\
You may as well have just put opfkfonoigogkgnokgnonoanongognnongoa. Me caveman ugg.
 
You may as well have just put opfkfonoigogkgnokgnonoanongognnongoa. Me caveman ugg.
Anything you need to run in CMD you can run from powershell.
&cmd means run this CMD from this window.

In your case, it would be
Code:
&cmd dism /online /cleanup-image /restorehealth
after running powershell as an administrator.
 
Okay, thank you for the help. When my ocing goes wrong I shall do this.:)
 
Back
Top