Posted On March 31, 2019

How to Convert Windows Application to Run as a Service

kimconnect 0 comments
blog.KimConnect.com >> Codes >> How to Convert Windows Application to Run as a Service

Pre-requisites:

  1. srvany.exe (from rktools)
  2. instsrv.exe

Copy srvany.exe and instsrv.exe from to c:\windows\system32 >> Run: CMD [as Administrator] >> “instsrv APP_NAME c:\windows\system32\srvany.exe” , press Enter >> Run: Regedit >> browse to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\APP_NAME >> Add Key “Parameters” >> Add string value “Application” = [Path_To_Application].exe (If application is not an executable, bat a batch file, set the value to “C:\Windows\system32\cmd.exe /k full_path_to_batch_file.bat” >> Create local user account >> Run: services.msc >> right-click APP_NAME service, Properties >> Log On tab, Enter local user account & password that has been created prior >> OK

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Uninstall Program Using Its Name

# uninstallProgramUsingId.ps1 $appName='Virtual Machine Manager Agent' $uninstallStringRegPaths='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' $uninstallStrings=Get-ChildItem -Path $uninstallStringRegPaths $uninstallString=($uninstallStrings|Get-ItemProperty|Where-Object {$_.DisplayName -match $appName}).UninstallString if($uninstallString.count…

Basic HTML and HTML5: Link to External Pages with Anchor Elements

<h2>CatPhotoApp</h2><main><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."><p>Kitty ipsum dolor sit amet, shed…

PowerShell: Grant Domain Admins Access to Directories

Snippet: # Messing around$shareDrives=@("E","F","G","I","J","N",'O','Q','R','S','T','U','V','W','Z','Y');$subdomain=(net config workstation) -match 'Workstation domain\s+\S+$' -replace '.+?(\S+)$','$1';$domainadmins="$subdomain`\Domain Admins"; $shareDrives | %{"Add-NTFSAccess…