WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Services

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntSvcCfgSet invalid parameter

Keywords: 	 wntSvcCfgSet invalid parameter  

Question:

I'm trying to set the Interactive service type of a service using wnSvccfgSet. It fails with WIL Extender error Invalid Parameter. Here's my code:
     ;Win32 service process that can interact with the desktop.
     wntSvcCfgSet("", "24 Hour_EXE", 0, 0, 256)

Answer:

All of the parameters specified look generally okay. However, you cannot specify SERVICE_INTERACTIVE_PROCESS by itself. You will also need to specify SERVICE_WIN32_OWN_PROCESS OR SERVICE_WIN32_SHARE_PROCESS. this could be done as follows:
     ;Win32 service process that can interact with the desktop. (256)
     ;Win32 service that runs in its own process. (16)
     wntSvcCfgSet("", "24 Hour_EXE", 0, 0, 16|256)

	OR

    ;Win32 service process that can interact with the desktop. (256)
    ;Win32 service that shares a process with other services. (32)
     wntSvcCfgSet("", "24 Hour_EXE", 0, 0, 32|256)


Related Question:

Question:

I thought I had this working. I had asked about this same error I was getting sometime ago and was given a beta Wwwnt34I.dll that corrected the problem. Now after upgrading to 99G the error is back.
ERROR: WIL Extender Error 531: Invalid Parameter
CODE:
nordata="DOMAIN\LOGONID|PASSWORD"
wntSvcCfgSet("", "Norton Program Scheduler", 0, 7, nordata)
The logon id does have service logon rights.

Answer:

The docs say that only services running under the LocalSystem account may be set as interactive.

You should use wntSvcCfgSet with request #0, to change the ServiceType to either 16 or 32 (but not 256). You can use wntSvcCfgSet to find out what it's currently set to.

Go to Services and manually unCheck the "Allow service to interact with desktop", stop/start the service, then execute:

   AddExtender("wwwnt34I.dll")
   nordata="Domain\LogonID|Password"
   if wntSvcStatus("", "Norton Program Scheduler", 0, 2)>1 then wntSvcControl("", "Norton Program
   Scheduler", 0, 1) ;stop the service
   wntSvcCfgSet("", "Norton Program Scheduler", 0, 0, 32) ;32=shared process, 16=own process
   wntSvcCfgSet("", "Norton Program Scheduler", 0, 7, nordata) ;set ID|PW 
   wntSvcCfgSet("", "Norton Program Scheduler", 0, 1, 2) ;set to start-up automatically
   wntSvcStart("", "Norton Program Scheduler", 0, "", "") ;start the service 

Article ID:   W14117
Filename:   wntSvcCfgSet invalid parameter.txt
File Created: 2001:03:01:14:22:40
Last Updated: 2001:03:01:14:22:40