Add SSL support to your SpiceWorks installation

Published by:

After spending countless hours trying to make heads or tails of all of the various tutorials online that purportedly show how to add SSL support to SpiceWorks, I decided to put together my own so that I can hopefully save at least one person from going grey too early. It took a lot of trial and error but these instructions at least work; whether or not they are 100% best-practice, I can’t say.

NOTES:
– This is very possibly not the “correct” way to do it, but it works. I’m definitely open to editing this post if someone can provide a better way, but for right now, these steps will get you going.
– This will not force the user to HTTPS, so if someone browses to the non-HTTPS version, they will see the non-HTTPS version. I leave it as an exercise for the user to determine his or her best way to force it. For posterity’s sake, since I know someone will ask: I have my non-HTTPS SpiceWorks port set to something random [3958 or something] in the “C:\Program Files (x86)\Spiceworks\httpd\conf\httpd.conf” file right at the top, on the “Listen ….” line, and then I have an empty IIS7 site set up that only listens on port 80, and under the “HTTP Redirect” section, I have “Redirect direct requests to this destination” – http://<myspiceworksURL>/portal and “Redirect all requests to exact destination (instead of relative to destination)” checked.

  1. Create a Certificate Signing Request in IIS7
    • Open IIS Manager (not 6.0)
    • Select the top level server object on the left hand panel (usually listed right below “Start Page”)
    • Under “IIS” section, open “Server Certificates”
    • Choose “Create Certificate Request” from the right hand panel
    • Enter the server’s hostname (the public hostname if this server will be internet-facing) in “Common Name” and fill out the rest of the fields accurately as your Certificate Authority (e.g. GoDaddy) will be verifying that they are correct
    • Click Next
    • Change Bit Length to at least 2048 (4096 is preferred)
    • Click Next
    • Enter a path and file name to write the certificate request to (e.g. “C:\Temp\CertificateRequest.csr”)
    • Click Finish
  2. Purchase cert using the certificate request generated in step 1
    • If given the option (I know GoDaddy offers this), when downloading the approved certificate, choose the “IIS7” format
    • Download and extract the certificate from the CA
  3. Import purchased cert into IIS when approved
    • Open IIS Manager (not 6.0)
    • Select the top level server object on the left hand panel (usually listed right below “Start Page”)
    • Under “IIS” section, open “Server Certificates”
    • Choose “Complete Certificate Request” from the right hand panel
    • In the first field, browse to find the completed certificate that you downloaded from your CA (you may have to change the search to *.* rather than *.cer if your CA provided the file as a .crt file)
    • In the “Friendly Name” field, enter something like “Spiceworks ” so you can differentiate it if you forget to delete the request from IIS when you’re done.
    • Click OK
  4. Export to .pfx format
    • Export cert to file called “tickets.pfx” by right-clicking the certificate with the same “Name” as the one you created in step 3, choose a password to secure the certificate with, and place in “C:\Program Files (x86)\Spiceworks\httpd\ssl”

  5. Stop Spiceworks service
  6. Open an administrator command prompt
    • Open an Administrator command prompt (right click “Command Prompt” and Run As Administrator) and enter the following commands:
      (When you are prompted for the import password, enter the password you created in step 4)
    • cd "C:\Program Files (x86)\Spiceworks\bin" 
      openssl.exe pkcs12 -in ..\httpd\ssl\tickets.pfx -nocerts -out ..\httpd\ssl\ssl-private-key.pem -nodes 
      openssl.exe pkcs12 -in ..\httpd\ssl\tickets.pfx -clcerts -nokeys -out ..\httpd\ssl\ssl-cert.pem 
      openssl.exe rsa -in ..\httpd\ssl\ssl-private-key.pem -out ..\httpd\ssl\ssl-private-key.pem 
      openssl.exe rsa -text -in ..\httpd\ssl\ssl-private-key.pem
  7. Restart Spiceworks service
    • SpiceWorks may take longer to start up than normal using a full core for up to 5 minutes but as far as I can tell, it’s just loading the cert, and once that 5-ish minutes (on an Intel Core i7-3620CM CPU) are up, it goes back to normal.

Conclusion
You should now see your purchased certificate when you browse to the SSL-ified URL of your SpiceWorks install!

WSUS Cleanup

Published by:

If you’ve ever been tasked with freeing up disk space on a WSUS server, there’s a very quick and painless way to do it without any need for those SQL clean up scripts. Going through this process once a quarter will keep the hard drive space on your WSUS server happy and breathable.

  1. Browse to SERVER -> Updates -> All Updates
  2. Set “Approval” to “Any except declined” and “Status” to “Any” and then hit “Refresh
  3. Right-click on the headings of the table, and make sure “Supersedence” is checked (by default, it will be the second column)
  4. Once it’s visible, sort by the Supersedence column (it’s the one with the icon that looks like one parent and 3 children)
  5. Select all of the updates that have either the SupersedesandSuperseded or Superseded icons. Do not select updates that have no icon or ones where only the parent is shown in blue.
  6. Right-click your selection and choose “Decline”
  7. Acknowledge the prompt that appears by clicking “Yes”
  8. Once the unneeded updates have been declined, browse to SERVER -> Options, and open the “Server Cleanup Wizard”
  9. Select “Unneeded update files” and click “Next”

Even after declining thousands of updates, this process should only take a few minutes at most and will instantly recover and space that is no longer necessary in your environment.

VIPRE Business Removal Tool

Published by:

After having to manually remove VIPRE Business from a number of machines in our office, I took the instructions listed at http://bit.ly/1qeyRtH and made a batch script that automates the whole process.

To use this script, do the following:

  1. Open notepad
  2. Copy and paste the following script
  3. Choose File -> Save As
  4. Save the file in a folder you have access to, with the filename: VIPRE.Removal.Tool.cmd
  5. Open Windows Explorer and browse to the folder you saved the file in, right click the file you created, and select “Run As Administrator”
@echo off
setlocal
 
echo ####################################################
echo #                                                  #
echo #         VIPRE Business Removal Tool v0.2         #
echo #                                                  #
echo #            Last update: Nov. 18, 2014            #
echo #    Source Instructions: http://bit.ly/1qeyRtH    #
echo #                                                  #
echo ####################################################
echo .
echo THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
echo IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
echo FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
echo AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
echo LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
echo OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
echo THE SOFTWARE.
echo.
set /p AREYOUSURE="Have you read, understand, and agree to the disclaimer? [y/N] "
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
 
 
echo.
echo Step 1: Running MsiExec /x on known GUIDs
echo.
echo NOTE: You may receive multiple errors saying something to the effect of:
echo.
echo This installation package could not be opened.  Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
echo.
echo This is normal.  Just click OK to proceed to the next one.
 
start /wait MsiExec.exe /x CC1CEA69-B7AF-47EE-AB64-68B7A1E2F3CF /qf /l*v "%temp%\VIPRE_MsiUninstall.log" REMOVE=ALL
start /wait MsiExec.exe /x D685DD76-77A3-4661-B9F0-7DAE2D651260 /qf /l*v "%temp%\VIPRE_MsiUninstall.log" REMOVE=ALL
start /wait MsiExec.exe /x 39A086B2-07D6-430B-AE5E-B8AC1CC843A7 /qf /l*v "%temp%\VIPRE_MsiUninstall.log" REMOVE=ALL
start /wait MsiExec.exe /x E10809C0-E65F-4493-A31B-3F86DB6E9E2A /qf /l*v "%temp%\VIPRE_MsiUninstall.log" REMOVE=ALL
 
echo Done.
echo.
echo Step 2: Stopping and deleting services
 
SC stop gfiark
SC Delete gfiark
 
SC stop gfiutil
SC Delete gfiutil
 
SC stop SBAMSvc
SC Delete SBAMSvc
 
SC stop SBAPIFS
SC Delete SBAPIFS
 
SC stop SBEMI
SC Delete SBEMI
 
SC stop SbFw
SC Delete SbFw
 
SC stop SBHIPS
SC Delete SBHIPS
 
SC stop SBPIMSVC
SC Delete SBPIMSVC
 
SC stop SBRE
SC Delete SBRE
 
 
echo Done.
echo.
echo Step 3: Removing registry entries if they exist
 
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{C1D1FC57-3EB9-4B21-BCA3-F1C927508200}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{C1D1FC57-3EB9-4B21-BCA3-F1C927508200}
)
 
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{CC1CEA69-B7AF-47EE-AB64-68B7A1E2F3CF}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{CC1CEA69-B7AF-47EE-AB64-68B7A1E2F3CF}
)
 
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{D685DD76-77A3-4661-B9F0-7DAE2D651260}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{D685DD76-77A3-4661-B9F0-7DAE2D651260}
)
 
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{39A086B2-07D6-430B-AE5E-B8AC1CC843A7}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{39A086B2-07D6-430B-AE5E-B8AC1CC843A7}
)
 
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{E10809C0-E65F-4493-A31B-3F86DB6E9E2A}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{E10809C0-E65F-4493-A31B-3F86DB6E9E2A}
)
 
reg query "HKLM\Software\Sunbelt Software\Sunbelt Enterprise Agent"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\Sunbelt Software\Sunbelt Enterprise Agent"
)
 
reg query "HKLM\Software\GFI Software\GFI Business Agent"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\GFI Software\GFI Business Agent"
)
 
reg query "HKLM\Software\GFI Software\Deployment"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\GFI Software\Deployment"
)
 
reg query HKLM\Software\GFI\LNSS10
if not ErrorLevel 1 (
  reg delete HKLM\Software\GFI\LNSS10
)
 
reg query HKLM\Software\SBAMSvc
if not ErrorLevel 1 (
  reg delete HKLM\Software\SBAMSvc
)
 
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C1D1FC57-3EB9-4B21-BCA3-F1C927508200}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C1D1FC57-3EB9-4B21-BCA3-F1C927508200}
)
 
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CC1CEA69-B7AF-47EE-AB64-68B7A1E2F3CF}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CC1CEA69-B7AF-47EE-AB64-68B7A1E2F3CF}
)
 
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D685DD76-77A3-4661-B9F0-7DAE2D651260}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D685DD76-77A3-4661-B9F0-7DAE2D651260}
)
 
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{39A086B2-07D6-430B-AE5E-B8AC1CC843A7}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{39A086B2-07D6-430B-AE5E-B8AC1CC843A7}
)
 
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E10809C0-E65F-4493-A31B-3F86DB6E9E2A}
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E10809C0-E65F-4493-A31B-3F86DB6E9E2A}
)
 
reg query "HKLM\Software\Wow6432Node\Sunbelt Software\Sunbelt Enterprise Agent"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\Wow6432Node\Sunbelt Software\Sunbelt Enterprise Agent"
)
 
reg query "HKLM\Software\Wow6432Node\GFI Software\GFI Business Agent"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\Wow6432Node\GFI Software\GFI Business Agent"
)
 
reg query "HKLM\Software\Wow6432Node\GFI Software\Deployment"
if not ErrorLevel 1 (
  reg delete "HKLM\Software\Wow6432Node\GFI Software\Deployment"
)
 
reg query HKLM\Software\Wow6432Node\GFI\LNSS10
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\GFI\LNSS10
)
 
reg query HKLM\Software\Wow6432Node\SBAMSvc
if not ErrorLevel 1 (
  reg delete HKLM\Software\Wow6432Node\SBAMSvc
)
 
reg query HKCR\Installer\Features\0C90801EF56E39443AB1F368BDE6E9A2
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Features\0C90801EF56E39443AB1F368BDE6E9A2
)
 
reg query HKCR\Installer\Features\116445D9734F351419E319EC305638CC
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Features\116445D9734F351419E319EC305638CC
)
 
reg query HKCR\Installer\Features\2B680A936D70B034EAE58BCAC18C347A
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Features\2B680A936D70B034EAE58BCAC18C347A
)
 
reg query HKCR\Installer\Features\C21346408A6123D4299DD1D723899DC1
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Features\C21346408A6123D4299DD1D723899DC1
)
 
reg query HKCR\Installer\Features\C928BABD4AA3D694D99624F210BD8691
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Features\C928BABD4AA3D694D99624F210BD8691
)
 
reg query HKCR\Installer\Products\0C90801EF56E39443AB1F368BDE6E9A2
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Products\0C90801EF56E39443AB1F368BDE6E9A2
)
 
reg query HKCR\Installer\Products\116445D9734F351419E319EC305638CC
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Products\116445D9734F351419E319EC305638CC
)
 
reg query HKCR\Installer\Products\2B680A936D70B034EAE58BCAC18C347A
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Products\2B680A936D70B034EAE58BCAC18C347A
)
 
reg query HKCR\Installer\Products\C21346408A6123D4299DD1D723899DC1
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Products\C21346408A6123D4299DD1D723899DC1
)
 
reg query HKCR\Installer\Products\C928BABD4AA3D694D99624F210BD8691
if not ErrorLevel 1 (
  reg delete HKCR\Installer\Products\C928BABD4AA3D694D99624F210BD8691
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Features\0C90801EF56E39443AB1F368BDE6E9A2
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Features\0C90801EF56E39443AB1F368BDE6E9A2
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Features\116445D9734F351419E319EC305638CC
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Features\116445D9734F351419E319EC305638CC
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Features\2B680A936D70B034EAE58BCAC18C347A
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Features\2B680A936D70B034EAE58BCAC18C347A
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Features\C21346408A6123D4299DD1D723899DC1
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Features\C21346408A6123D4299DD1D723899DC1
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Features\C928BABD4AA3D694D99624F210BD8691
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Features\C928BABD4AA3D694D99624F210BD8691
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Products\0C90801EF56E39443AB1F368BDE6E9A2
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Products\0C90801EF56E39443AB1F368BDE6E9A2
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Products\116445D9734F351419E319EC305638CC
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Products\116445D9734F351419E319EC305638CC
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Products\2B680A936D70B034EAE58BCAC18C347A
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Products\2B680A936D70B034EAE58BCAC18C347A
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Products\C21346408A6123D4299DD1D723899DC1
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Products\C21346408A6123D4299DD1D723899DC1
)
 
reg query HKLM\SOFTWARE\Classes\Installer\Products\C928BABD4AA3D694D99624F210BD8691
if not ErrorLevel 1 (
  reg delete HKLM\SOFTWARE\Classes\Installer\Products\C928BABD4AA3D694D99624F210BD8691
)
 
 
 
echo Done.
echo.
echo Step 4: Unregistering SBAMScanShell.dll
 
 
CD "C:\Program Files (x86)\GFI Software\GFIAgent\"
RegSvr32 /u SBAMScanShellExt.dll /s
 
 
echo Done.
echo.
echo Step 5: Removing folders and files if they exist
 
 
if exist "C:\Program Files\VIPRE Business Agent\" rmdir /s /q "C:\Program Files\VIPRE Business Agent\"
if exist "C:\Program Files\GFI Software\Deployment\" rmdir /s /q "C:\Program Files\GFI Software\Deployment\"
if exist "C:\Program Files\GFI Software\GFIAgent\" rmdir /s /q "C:\Program Files\GFI Software\GFIAgent\"
if exist "C:\Program Files\GFI Software\LanGuard 10\" rmdir /s /q "C:\Program Files\GFI Software\LanGuard 10\"
if exist "C:\Program Files\Sunbelt Software\Deployment\" rmdir /s /q "C:\Program Files\Sunbelt Software\Deployment\"
if exist "C:\Program Files\Sunbelt Software\SBEAgent\" rmdir /s /q "C:\Program Files\Sunbelt Software\SBEAgent\"
if exist "C:\Program Files (x86)\VIPRE Business Agent\" rmdir /s /q "C:\Program Files (x86)\VIPRE Business Agent\"
if exist "C:\Program Files (x86)\GFI Software\Deployment\" rmdir /s /q "C:\Program Files (x86)\GFI Software\Deployment\"
if exist "C:\Program Files (x86)\GFI Software\GFIAgent\" rmdir /s /q "C:\Program Files (x86)\GFI Software\GFIAgent\"
if exist "C:\Program Files (x86)\GFI Software\LanGuard 10\" rmdir /s /q "C:\Program Files (x86)\GFI Software\LanGuard 10\"
if exist "C:\Program Files (x86)\Sunbelt Software\Deployment\" rmdir /s /q "C:\Program Files (x86)\Sunbelt Software\Deployment\"
if exist "C:\Program Files (x86)\Sunbelt Software\SBEAgent\" rmdir /s /q "C:\Program Files (x86)\Sunbelt Software\SBEAgent\"
if exist "C:\ProgramData\VIPRE Business Agent\" rmdir /s /q "C:\ProgramData\VIPRE Business Agent\"
if exist "C:\ProgramData\GFI Software\Antimalware\" rmdir /s /q "C:\ProgramData\GFI Software\Antimalware\"
if exist "C:\ProgramData\GFI Software\LanGuard 10\" rmdir /s /q "C:\ProgramData\GFI Software\LanGuard 10\"
if exist "C:\ProgramData\Sunbelt Software\Antimalware\" rmdir /s /q "C:\ProgramData\Sunbelt Software\Antimalware\"
if exist "C:\Documents and Settings\All Users\Application Data\VIPRE Business Agent\" rmdir /s /q "C:\Documents and Settings\All Users\Application Data\VIPRE Business Agent\"
if exist "C:\Documents and Settings\All Users\Application Data\GFI Software\Antimalware\" rmdir /s /q "C:\Documents and Settings\All Users\Application Data\GFI Software\Antimalware\"
if exist "C:\Documents and Settings\All Users\Application Data\GFI Software\LanGuard 10\" rmdir /s /q "C:\Documents and Settings\All Users\Application Data\GFI Software\LanGuard 10\"
if exist "C:\Documents and Settings\All Users\Application Data\Sunbelt Software\Antimalware\" rmdir /s /q "C:\Documents and Settings\All Users\Application Data\Sunbelt Software\Antimalware\"
if exist "%SYSTEMROOT%\system32\drivers\sbaphd.sys" del "%SYSTEMROOT%\system32\drivers\sbaphd.sys"
if exist "%SYSTEMROOT%\system32\drivers\sbapifs.sys" del "%SYSTEMROOT%\system32\drivers\sbapifs.sys"
if exist "%SYSTEMROOT%\system32\drivers\SbFw.sys" del "%SYSTEMROOT%\system32\drivers\SbFw.sys"
if exist "%SYSTEMROOT%\system32\drivers\SbFwIm.sys" del "%SYSTEMROOT%\system32\drivers\SbFwIm.sys"
if exist "%SYSTEMROOT%\system32\drivers\sbhips.sys" del "%SYSTEMROOT%\system32\drivers\sbhips.sys"
if exist "%SYSTEMROOT%\system32\drivers\SBREDrv.sys" del "%SYSTEMROOT%\system32\drivers\SBREDrv.sys"
if exist "%SYSTEMROOT%\system32\drivers\sbtis.sys" del "%SYSTEMROOT%\system32\drivers\sbtis.sys"
if exist "%SYSTEMROOT%\system32\drivers\sbwtis.sys" del "%SYSTEMROOT%\system32\drivers\sbwtis.sys"
if exist "%SYSTEMROOT%\system32\drivers\gfiark.sys" del "%SYSTEMROOT%\system32\drivers\gfiark.sys"
if exist "%SYSTEMROOT%\system32\drivers\gfiutil.sys" del "%SYSTEMROOT%\system32\drivers\gfiutil.sys"
 
echo Done.
echo.
echo This script is now complete.  The final task is to reboot.
echo Please ensure you've saved everything and the system is
echo prepared to reboot *IMMEDIATELY*.
echo.
set /p SHOULDIREBOOT="Would you like to reboot the computer now? [y/N]"
IF /I "%SHOULDIREBOOT%" NEQ "Y" GOTO END
 
shutdown -t 0 -r
 
:END
endlocal

Changelog

  • v0.1 – Original version
  • v0.2 – Credit to cat5inthecradle; added reboot confirmation and fixes to registry entries with spaces in them