How to change user credentials of windows service from command line?

sc.exe config “Service Name” obj= “DOMAIN\User” password= “password” type= own See Shortcut Setting Log-On Credentials for Windows Services ยป jonathanmalek.com. @MattT points out that on Windows Server 2008R2 you have to add type= own, but prior to that version it isn’t necessary. In PowerShell 3+, you can avoid escaping the arguments with the stop-parsing symbol: … Read more

How to get the path of a batch script without the trailing backslash in a single command?

Instead of removing the trailing backslash, adding a trailing dot is semantically equivalent for many software. C:\Windows is equivalent to C:\Windows\. echo %dp0 >C:\Windows\ echo %dp0. >C:\Windows\. For example, robocopy accepts only directories without trailing spaces. This errors out: robocopy “C:\myDir” %~dp0 This is successful: robocopy “C:\myDir” %~dp0.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)