Catatan

Force Execute File to Run As Administrator

Imej
Right-click your WPF project to add new Item: "Add->New Item..." Select "Application Manifest File" and click Add Double Click your newly created manifest file and change the <requestedExecutionLevel level="asInvoker" uiAccess="false" /> to <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> Then the WPF application would run as Administrator. References link:  https://stackoverflow.com/a/53431997

How to make Windows Service start as "Automatic (Delayed Start)" ?

  Now that .NET 4.0 is here: serviceInstaller1.StartType = ServiceStartMode.Automatic; serviceInstaller1.DelayedAutoStart = true ; https://stackoverflow.com/a/9525289

Stop and Start a service via batch or cmd file?

  net start [serviceName] and net stop [serviceName] tell you whether they have succeeded or failed pretty clearly. For example U:\>net stop alerter The Alerter service is not started. More help is available by typing NET HELPMSG 3521. If running from a batch file, you have access to the ERRORLEVEL of the return code. 0 indicates success. Anything higher indicates failure. As a bat file,  error.bat : @echo off net stop alerter if ERRORLEVEL 1 goto error exit :error echo There was a problem pause The output looks like this: U:\>error.bat The Alerter service is not started. More help is available by typing NET HELPMSG 3521. There was a problem Press any key to continue . . . Return Codes - 0 = Success - 1 = Not Supported - 2 = Access Denied - 3 = Dependent Services Running - 4 = Invalid Service Control - 5 = Service Cannot Accept Control - 6 = Service Not Active - 7 = Service Request Timeout - 8 = Unknown Failure - 9 = Path Not Found - 10 = Service Already Running -

How to run a ".bat" file during installation?

  62 Well, after much searching and trial and error I have solved this. I'm not sure if this is the best way, but it works. Here's the scenario: I have an application I would like to deploy via a Visual Studio Setup project. In addition to my application files, I would like to create a subdirectory in the target directory that contains a batch (.bat) file. I would like this file to run at the end of the installation process. Here's what you do: Create a setup project and configure as you normally would, including the subdirectory in which you'll place your batch file (you can just place it in the Application Folder directly if you don't want it in a subdirectory). In the "File System" view (right-click on the project in Solution Explorer->View->File System), add the batch file you want to execute  and  cmd.exe (C:\Windows\System32\cmd.exe) Open the "Custom Actions" view (right-click on the project in Solution Explorer->View->Custom Ac

Windows update services was disabled

 Windows update error (0x80080005) and Net start wuauserv Reference:  https://answers.microsoft.com/en-us/windows/forum/all/windows-update-error-0x80080005-and-net-start/da8cab53-2a01-43d5-bf3e-27f020bfff17 Hello, Please run  Windows Update troubleshooter  from Settings app > Update & security > Troubleshoot. See if it helps. If not, s uggest you to run System File Checker scan: 1. Search for 'command prompt' using Cortana or Windows Search. 2. From results, right click on Command Prompt and select Run as administrator. 3. Type  sfc /scannow  command and press Enter key. 4. Let the command complete and then reboot the machine. If SFC can fails, try these steps: 1. Search for 'windows powershell' using Cortana or Windows Search. 2. From results, choose Windows PowerShell and select Run as administrator. 3. Then type/paste following and press Enter key: Repair-WindowsImage -Online -RestoreHealth 4. Let the command complete, restart your system then. Now try to s

ASP.Net perform auto reload

Imej
Working with SQL Server ROWCOUNT

ASP.NET show console

Page.Response.Write("<script>console.log(' Message : " + message + "');</script>");