I love my new Samsung Series 9 laptop even more now that I have finally put to rest the arcane issue that I described here. I’ll put down some geeky details for people who might stumble on this in a Google search. The rest of you can go back to work – this isn’t for you.
When the Samsung Series 9 is shut down and restarts, the Windows Search service startup is set to “Disabled.” Although it also shows “Started,” in fact it is not functioning.
If the service is stopped, set to “Automatic (Delayed),” and restarted, it behaves normally until the system is shut down again.
If Outlook is started before the service is running correctly, the search service does not work correctly in Outlook.
As I described in the first post, the Indexing Service was turned off. Both the Indexing Service and the Windows Search Service have to be running for Windows 7 to handle searches correctly.
For unknown reasons, Samsung left a file named SVCDELAY.EXE in the C:WindowsTemp folder. A scheduled task runs that file whenever any user logs in. The accompanying SVCDELAY.INI file has these lines:
ShowWin = FALSE
ShowWin = FALSE
Setup1=sc config wsearch start= delayed-auto
Setup2=net start wsearch
Setup3=sc config wsearch start= disabled
Setup4=sc config sysmain start= auto
The sequence of WSearch commands – Setup1, Setup2, Setup3 – matches what happens. Apparently the SVCDELAY.EXE program processes those lines in order – sets the Windows Search service to Delayed Start, starts it, then sets it to Disabled, which breaks it.
The location in C:WindowsTemp leads me to think that these files were supposed to be removed before the system is used. In any case, removing the scheduled task puts everything back to normal.
THE PLANNED WORKAROUND
It took hours to track that down. I had planned to work around the issue this way. It’s not necessary now that I’ve discovered the underlying cause but the exercise might be helpful.
The idea was to change the service startup type from the command line, then start the service. Here’s what I wound up with in a little batch file named StartWSearch.cmd.
sc stop WSearch
timeout /t 10 /nobreak
sc config WSearch start= delayed-auto
timeout /t 5 /nobreak
sc start WSearch
- Stopping a service with the SC command requires the underlying service name, not the one shown in the Services control panel. Right-click on a service and click on Properties and you’ll see the service name. The Windows Search service name is “WSearch.”
- I had to insert a delay with the Timeout command for the service to have time to stop. “Timeout” is apparently new for Vista and Windows 7 – I remember having to do other tricks to insert a delay into an old DOS batch file.
- The /nobreak switch ensures that the batch file won’t be interrupted by a random keyboard press.
- The batch file has to be run as administrator or it will show a series of “Error Access Denied” messages and terminate. It’s possible to right-click and run as administrator manually but I was trying to automate it. When you look at the properties of the batch file, the checkbox to run as administrator is greyed out on the Compatibility tab.
- RUNNING A BATCH FILE WITH ADMINISTRATOR PERMISSIONS IN WINDOWS 7: Create a shortcut to the batch file, then right-click the shortcut and click on Properties. There is an “Advanced” button on the Shortcut tab – and lo and behold, there is another checkbox to run the shortcut as an administrator.
The batch file would have been an adequate workaround as long as I remembered to run it after I logged in (or solved the problem that was keeping it from running when it was in the Startup folder.) Fortunately it wound up not being necessary after tracking down the mysterious SVCDELAY.EXE that caused all the trouble.
I’m ready for easier problems now. This was a tough one.