How do I select the user account that will run the Windows service (Run As) from the command line?


Sopalajo de Arrierez

As one of the steps to install the CRON daemon for CygWin in Windows , changing (along with a few other modifications) the run (worth mentioning) of the CRON properties you just installed (not required on WinXP, but seems to have been strongly enforced since Win7 suggestion). Serve. Here is the GUI method window (sorry, my windows is spanish), where I can select any other user ("cygrunsrv" in my example, but it could be any other user):

"Run As" property - execute the service as another account other than "system"

I've looked at the documentation and the sc command doesn't seem to have that functionality. All I found is this option, to allow the service to interact with the desktop:

sc config servicename type= interact type= own

But that's not the change I'm looking for.
Is there a way to accomplish this via the command line?

wmz

You should be able to do it with obj=and password=parameters sc config
(maybe it depends on the version, but I can't find any info)

Running sc config /?gives me the following options:

CONFIG OPTIONS: NOTE: The option name includes the equal sign. type= <own|share|interact|kernel|filesys|rec|adapt> start= <boot|system|auto|demand|disabled> error= <normal|severe|critical|ignore> binPath= <BinaryPathName> group= <LoadOrderGroup> tag= <yes|no> depend= <Dependencies(separated by / (forward slash))> obj= <AccountName|ObjectName> DisplayName= <display name> password= <password>

Full description here : http://technet.microsoft.com/en-us/library/cc990290.aspx

Related


How do I install a script to run anywhere from the command line?

jeffbr13: If I have a basic Python script with a hashbang and something that doesn't exist, I can run it from a terminal on Linux /path/to/file/MyScript [args] It will execute the program without going through the interpreter or any file extension. So I will

How can I run a Java program from the command line on Windows?

Elizabeth Turner: I am trying to execute a Java program from the command line in Windows. Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java

How do I install a script to run anywhere from the command line?

jeffbr13: If I have a basic Python script with a hashbang and something that doesn't exist, I can run it from a terminal on Linux /path/to/file/MyScript [args] It will execute the program without going through the interpreter or any file extension. So I will

How can I run a Java program from the command line on Windows?

Elizabeth Turner: I am trying to execute a Java program from the command line in Windows. Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java

How do I run a Groovy script for Java from the command line?

Ripper 234: I'm trying to use groovyc, but something is not right: >echo println("Hello world") > test.groovy >groovy test.groovy Hello world >groovyc test.groovy >java -cp C:\utils\groovy-1.8.1\embeddable\groovy-all-1.8.1.jar test Error: Could not find or loa

How do I run Clozure CL from the Windows command line?

Jesse Rooney I'm trying to install Clozure CL with my own instructions and want me to add the files ccland ccl64my way, but they have no file extensions and Windows doesn't know how to run them. I ended up looking at the files and it starts with #!/bin/sh. As

How do I run Clozure CL from the Windows command line?

Jesse Rooney I'm trying to install Clozure CL with my own instructions and want me to add the files ccland ccl64my way, but they have no file extensions and Windows doesn't know how to run them. I ended up looking at the files and it starts with #!/bin/sh. As

How do I run a karate test from the command line?

Memo I created my project using the archetype found in the documentation. However, the tests cannot be run from the command line. All tests are ignored. I'm running it and even mvn testif I specify mvn test -Dtest=SystemTestsRunnerit it gives me an exception t

How do I run a Chrome app from the command line?

octave reference I am new to linux and just installed Elementary OS. I installed Chrome and noticed that Workflowy and many other Chrome apps were also installed as shown in the screenshot. But how do I find the command to run a Chrome app (e.g. workflow)? (so

How can I run a .js file from the command line on Windows?

Radek I have a shortcut for 'target' "C:\Users\Public\TestPro\TestPro Automation Framework\taf.js". I want to run the file from a batch file, so I copy the "C:\Users\Public\TestPro\TestPro Automation Framework\taf.js"command line to cmd.exe and hit enter. It's

How to run Windows SDK command prompt from command line?

dessert I have a running guide Select Start -> All Programs -> Microsoft Windows SDK v7.1 and open the Windows SDK 7.1 command prompt. Windows 8.1 is outdated I installed something called "Windows Software Development Kit (SDK) for Windows 8.1" from here https

How do I install a script to run anywhere from the command line?

jeffbr13: If I have a basic Python script with a hashbang and something that doesn't exist, I can run it from a terminal on Linux /path/to/file/MyScript [args] It will execute the program without going through the interpreter or any file extension. So I will

How do I run a Groovy script for Java from the command line?

Ripper 234: I'm trying to use groovyc, but something is not right: >echo println("Hello world") > test.groovy >groovy test.groovy Hello world >groovyc test.groovy >java -cp C:\utils\groovy-1.8.1\embeddable\groovy-all-1.8.1.jar test Error: Could not find or loa

How can I run a Java program from the command line on Windows?

Elizabeth Turner: I am trying to execute a Java program from the command line in Windows. Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java

How do I run a karate test from the command line?

Memo I created my project using the archetype found in the documentation. However, the tests cannot be run from the command line. All tests are ignored. I'm running it and even mvn testif I specify mvn test -Dtest=SystemTestsRunnerit it gives me an exception t

How do I run a karate test from the command line?

Memo I created my project using the archetype found in the documentation. However, the tests cannot be run from the command line. All tests are ignored. I'm running it and even mvn testif I specify mvn test -Dtest=SystemTestsRunnerit it gives me an exception t

How do I run a Chrome app from the command line?

octave reference I am new to linux and just installed Elementary OS. I installed Chrome and noticed that Workflowy and many other Chrome apps were also installed as shown in the screenshot. But how do I find the command to run a Chrome app (e.g. workflow)? (so

How to run Windows SDK command prompt from command line?

dessert I have a running guide Select Start -> All Programs -> Microsoft Windows SDK v7.1 and open the Windows SDK 7.1 command prompt. Windows 8.1 is outdated I installed something called "Windows Software Development Kit (SDK) for Windows 8.1" from here https

How can I run a .js file from the command line on Windows?

Radek I have a shortcut for 'target' "C:\Users\Public\TestPro\TestPro Automation Framework\taf.js". I want to run the file from a batch file, so I copy the "C:\Users\Public\TestPro\TestPro Automation Framework\taf.js"command line to cmd.exe and hit enter. It's