Link to home
Start Free TrialLog in
Avatar of Mike
MikeFlag for United States of America

asked on

Need help setting up a Powershell script

I need to help creating a power shell script to /delete (i.e. bcdedit /delete {current}) the current bcd definition and restart the computer.. can somebody help me with this.....
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill Prew
Bill Prew

And of course in a simple BAT script it could be as follows.  Both the bcdedit and shutdown command have other options that you might need/want to explore.  I also believe this needs to be run in elevated privs.

bcdedit /delete {current}
shutdown /r

Open in new window



»bp
Avatar of Mike

ASKER

Thanks, David  - You got me in the right direction ... Still Learning PowerShell....    string I using below  



start-process "C:\Windows\system32\bcdedit.exe"  -Argumentlist "/delete {current}"