Change interactive flag on service from command line

  • Thread starter Thread starter Max
  • Start date Start date
M

Max

Hello,

I've been struggling with this issue and can't seem to find a solution
thus far.

Basically I need to figure out a way through the command line to change
the option in a service to allow it to interact with the desktop. This
is a simple checkmark in the service control panel applet. I've tried
using sc.exe which is the only command line tool I know of, and none of
the options seem to provide this function.

This is for an installation script of a service/app that I need to
deploy across many computers.

Any other ideas?

Thanks,
Max
 
I've been struggling with this issue and can't seem to find a solution
thus far.

Basically I need to figure out a way through the command line to change
the option in a service to allow it to interact with the desktop. This
is a simple checkmark in the service control panel applet. I've tried
using sc.exe which is the only command line tool I know of, and none of
the options seem to provide this function.

This is for an installation script of a service/app that I need to
deploy across many computers.

Any other ideas?

You can use REG.EXE to modify the relevant Registry key(s) (if you know what
to modify, of course).


Massimo
 
Allow service to interact with desktop
[[Specifies whether the service provides a user interface on a desktop that
can be used by whomever is logged on when the service is started. This
option is available only if the service is running as a LocalSystem
account.]]

Use: SC CONFIG

SC CONFIG modifies the value of a service's entries in the registry and in
the Service Control Manager's database.

type= interact type= own
or
type= interact type= share

interact
[[The service can interact with the desktop, receiving input from users.
Interactive services must be run under the LocalSystem account. This type
must be used in conjunction with type= own or type= shared (for example,
type= interact type= own). Using type= interact by itself will generate an
invalid parameter error.]]

See SC CONFIG in SC HELP...
Start | Run | Type:

hh ntcmds.chm::/sc.htm

Click OK, then click the [+] SC CONFIG

Also type: SC CONFIG /? in a command prompt.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Thanks, after testing sc.exe I finally got it working. I had
investigated sc.exe but never could get it working as the help via the
command line help switch was not as thorough as the method with the chm
file you provided. I am now able to set the service as interactive from
the command line via my program and then restart....all using sc.exe.

Thanks again,
Max

Allow service to interact with desktop
[[Specifies whether the service provides a user interface on a desktop that
can be used by whomever is logged on when the service is started. This
option is available only if the service is running as a LocalSystem
account.]]

Use: SC CONFIG

SC CONFIG modifies the value of a service's entries in the registry and in
the Service Control Manager's database.

type= interact type= own
or
type= interact type= share

interact
[[The service can interact with the desktop, receiving input from users.
Interactive services must be run under the LocalSystem account. This type
must be used in conjunction with type= own or type= shared (for example,
type= interact type= own). Using type= interact by itself will generate an
invalid parameter error.]]

See SC CONFIG in SC HELP...
Start | Run | Type:

hh ntcmds.chm::/sc.htm

Click OK, then click the [+] SC CONFIG

Also type: SC CONFIG /? in a command prompt.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Max said:
I've been struggling with this issue and can't seem to find a solution
thus far.
Basically I need to figure out a way through the command line to change
the option in a service to allow it to interact with the desktop. This
is a simple checkmark in the service control panel applet. I've tried
using sc.exe which is the only command line tool I know of, and none of
the options seem to provide this function.
This is for an installation script of a service/app that I need to
deploy across many computers.
Any other ideas?
Thanks,
Max
 
Glad to hear it, Max. Keep having fun.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Max said:
Thanks, after testing sc.exe I finally got it working. I had
investigated sc.exe but never could get it working as the help via the
command line help switch was not as thorough as the method with the chm
file you provided. I am now able to set the service as interactive from
the command line via my program and then restart....all using sc.exe.

Thanks again,
Max

Allow service to interact with desktop
[[Specifies whether the service provides a user interface on a desktop
that can be used by whomever is logged on when the service is started.
This option is available only if the service is running as a LocalSystem
account.]]

Use: SC CONFIG

SC CONFIG modifies the value of a service's entries in the registry and
in the Service Control Manager's database.

type= interact type= own
or
type= interact type= share

interact
[[The service can interact with the desktop, receiving input from users.
Interactive services must be run under the LocalSystem account. This type
must be used in conjunction with type= own or type= shared (for example,
type= interact type= own). Using type= interact by itself will generate
an invalid parameter error.]]

See SC CONFIG in SC HELP...
Start | Run | Type:

hh ntcmds.chm::/sc.htm

Click OK, then click the [+] SC CONFIG

Also type: SC CONFIG /? in a command prompt.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Max said:
I've been struggling with this issue and can't seem to find a solution
thus far.
Basically I need to figure out a way through the command line to change
the option in a service to allow it to interact with the desktop. This
is a simple checkmark in the service control panel applet. I've tried
using sc.exe which is the only command line tool I know of, and none of
the options seem to provide this function.
This is for an installation script of a service/app that I need to
deploy across many computers.
Any other ideas?
Thanks,
Max
 
Back
Top