Skip to content

Instantly share code, notes, and snippets.

@tresf
Last active November 18, 2019 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tresf/f116ade5560a4739d5af3a75d15d70b1 to your computer and use it in GitHub Desktop.
Save tresf/f116ade5560a4739d5af3a75d15d70b1 to your computer and use it in GitHub Desktop.
QZ Tray Service
REM ###### 1. Run the site to be using QZ Tray and click "Remember this decision"
REM ###### 2. Create a batch file that launches QZ Tray
echo java -Xms512M -jar "%~dp0\qz-tray.jar" %* > "%PROGRAMFILES%\QZ Tray\qz-tray.bat"
REM ###### 3. Make a location for SYSTEM certificate white-list
mkdir "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz"
REM ###### 4. Copy the "allowed.dat" to the SYSTEM
copy /Y "%APPDATA%\qz\allowed.dat" "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz\allowed.dat"
REM ###### 5. Install the service
nssm install "QZ Tray" "%PROGRAMFILES%\QZ Tray\qz-tray.bat"
nssm set "QZ Tray" Description "Browser printing utility"
REM ###### 6. Start the service
net start "QZ Tray"
REM ###### 99. Remove the service
REM net stop "QZ Tray"
REM nssm remove "QZ Tray"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment