Skip to content

Instantly share code, notes, and snippets.

@tresf tresf/make-service.bat
Last active Nov 18, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.