1

I am trying to re-install antivirus on multiple computers which requires reboot. I have a script to uninstall the antivirus and reboot but for installation, I have to run another script. Is there anyway to ran only one script which will perform UNINSTALL+REBOOT+INSTALL

Rohit Singh
  • 47
  • 2
  • 10
  • https://stackoverflow.com/questions/24469265/running-a-powershell-script-restarting-and-then-continue-to-run – Glenn Jan 09 '20 at 04:16
  • 2
    Does this answer your question? [Running a Powershell script, restarting and then continue to run](https://stackoverflow.com/questions/24469265/running-a-powershell-script-restarting-and-then-continue-to-run) – PiNaKa30 Jan 09 '20 at 04:23

1 Answers1

0

Use this:

cd HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce
new-itemproperty . TheKey -propertytype String -value "Powershell.exe Powershell script"
Restart-Computer 
Wasif
  • 14,755
  • 3
  • 14
  • 34
  • https://community.spiceworks.com/topic/1334887-restart-a-computer-remotely-using-powershell-and-prompt-for-computer-name-and-un – Patrick Burwell Nov 03 '22 at 15:02