When I run the following command I get a Failed message? Anyone know what this means or how I can work around it? And no I don't want to use wmic or vbs LoL. This is actualy part of a batch script but I get the error when trying command on some computer and not others manually.
sc [servername] qc MSSQLServerOLAPService
[SC] QueryServiceConfig FAILED 122:
The data area passed to a system call is too small.
[SC] GetServiceConfig needs 604 bytes
Working with sc.exe and getting a error
Moderator: DosItHelp
Re: Working with sc.exe and getting a error
There's a description of the fault and a workaround mentioned here.
Imagepath info
http://technet.microsoft.com/en-us/libr ... 10%29.aspx
http://www.windows-api.com/microsoft/Win32-WMI/29556382/win32servicestartname-is-null.aspx
Hi Jeffrey.
I think I've found the problem. Apparently the CIMV2 WMI provider is using
a fixed-size buffer when it calls QueryServiceConfig(). If the buffer isn't
big enough to hold the results, it fails silently and is unable to display
many of the properties of the Win32_Service instance.
The service in question has a very long ImagePath; 545 characters (1090
bytes).
The clue was SC.EXE, which suffers from the same problem but at least
reports the error. Here's an example:
C:\>sc \\MYSERVER qc "MyService"
[SC] QueryServiceConfig FAILED 122:
The data area passed to a system call is too small.
[SC] GetServiceConfig needs 1252 bytes
When I changed the service's "ImagePath" in the registry to something
shorter, it worked:
C:\>sc \\MYSERVER qc "MyService"
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: MyService
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : This is a test.
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : MyService
DEPENDENCIES :
SERVICE_START_NAME : MYDOMAIN\MyUser
Imagepath info
http://technet.microsoft.com/en-us/libr ... 10%29.aspx
Re: Working with sc.exe and getting a error
Thank you that got me to the answer.
sc [servername] qc MSSQLServerOLAPService <buffersize>
sc [servername] qc MSSQLServerOLAPService 5000
Note, I could have added 1024+604 since that is what the error asked for but just incase my batch asked for a service that needs more it should have plenty.
sc [servername] qc MSSQLServerOLAPService <buffersize>
sc [servername] qc MSSQLServerOLAPService 5000
Note, I could have added 1024+604 since that is what the error asked for but just incase my batch asked for a service that needs more it should have plenty.
Re: Working with sc.exe and getting a error
That's good. Thanks for providing the followup.