How to resolve “'installutil' is not recognized as an internal or external command, operable program or batch file.”?

后端 未结 12 1699
情话喂你
情话喂你 2020-12-07 08:41

Just tried to run an application via the following:

\"enter

I have browsed to

相关标签:
12条回答
  • 2020-12-07 09:25
    Add this in windows Environmental variables
    First: Right click on My computer or This PC
    Second: Click on Environmental Variables
    Third: add this path after clicking on path
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe
    
    0 讨论(0)
  • 2020-12-07 09:25

    Just add the installUtil.exe path in the environment variable to fix this issue.

    Example:

     C:\Windows\Microsoft.NET\Framework\v4.0.30319
    
    0 讨论(0)
  • 2020-12-07 09:26

    Before Installing service using command line...

    use 2 steps:

    1. cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
    2. InstallUtil.exe Path\MyWindowsService.exe
    0 讨论(0)
  • 2020-12-07 09:27

    This might have occurred because you would not have opened the Command Prompt as an administrator or with Administrative Privileges.

    0 讨论(0)
  • 2020-12-07 09:33

    I got this after I had went back to 2015 from 2017 and I was still using the 2017 command prompt. Something to check.

    0 讨论(0)
  • 2020-12-07 09:35

    Found a solution on bytes.com

    The code to install a service:

    @ECHO Installing Service...
    @SET PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
    @InstallUtil  C:\Unlock_4_Service\bin\Debug\Unlock_4_Service.exe
    @ECHO Install Done.
    @pause
    

    @InstallUtil <.exe file path of your windows service>

    Code to uninstall the service

    @ECHO Installing Service...
    @SET PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
    @InstallUtil /u C:\Unlock_4_Service\bin\Debug\Unlock_4_Service.exe
    @ECHO Uninstall Done.
    @pause
    

    @InstallUtil /u <.exe file path of your windows service >

    Save the 2 files as service_install.bat and service_uninstall.bat

    Run the files as administrator, every time you have to install or uninstall the service. enter image description here

    0 讨论(0)
提交回复
热议问题