Skip to content

Commit

Permalink
Added setlocal and enclocal declarations to NVDARemoteCertificate.cmd…
Browse files Browse the repository at this point in the history
…. Windows service manager now will try to run as administrator and prompt for required privileges
  • Loading branch information
jmdaweb committed Oct 7, 2018
1 parent 0273898 commit f033300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions windows/NVDARemoteCertificate.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@echo off
title NVDA Remote Server self-signed certificate generator
cd %~dp0
setlocal
set OPENSSL_CONF=%~dp0openssl.cnf
openssl genrsa -out key.key 4096
openssl req -new -key key.key -out cert.csr
Expand All @@ -10,6 +11,7 @@ copy key.key + cert.crt server.pem
del key.key
del cert.csr
del cert.crt
endlocal
echo Certificate successfully created
echo You must restart the server for the changes to take effect. Press any key to exit.
pause
7 changes: 7 additions & 0 deletions windows/service_manager.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@echo off
title NVDARemote server service manager
fltmc 1>nul 2>nul || (
cd /d "%~dp0"
cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/c cd ""%~dp0"" && ""%~dpnx0""", "", "runas", 1 > "%temp%\GetAdmin.vbs"
cscript "%temp%\GetAdmin.vbs"
del /f /q "%temp%\GetAdmin.vbs" 1>nul 2>nul
exit
)
:menu
cls
echo Welcome to the NVDARemote server service manager.
Expand Down

0 comments on commit f033300

Please sign in to comment.