The following information was contributed by one of our customers who was able to run WinWedge as a service under Windows NT and 2000. While it does work well in older versions of Windows, we do not directly support this technique.
If you are using a later version of Windows or if you want an easier solution, you can use the Windows Task Scheduler to run WinWedge at startup, regardless of the logged on user. This effectively does the same thing as running a program as a service.
Note: Instead of configuring WinWedge as a service to automatically open and activate your configuration, a better alternative might be to place a shortcut of your .SW3 WinWedge configuration file in Windows Start-Up Folder (in the Start menu) and select “Minimize WinWedge upon Activation” located in the Activate menu of WinWedge Pro or in the Preferences screen under Define > Preferences in WinWedge Standard.
Overview
A utility called srvany.exe that comes along with the Windows NT Resource Kit is used to install Winwedge as a NT Service with the following benefits.
- When applications run as a service, they are not closed during logoff. So users do not need to start them each time they log on, nor can they kill them if the services control has been restricted to the users.
- Server applications can service requests even when no user is logged on.
- Applications can run and perform tasks specific to a logon account that is different from the user who is currently logged on.
Installing
Create a directory c:service and copy the following files in it:
- Instsrv.exe
- Srvany.exe
- Wedge.bat
Note: The file “Wedge.bat
” is a batch file that contains the command line used to launch and activate the Software Wedge with a specific WinWedge configuration file. This file will need to be created or modified to contain the correct path to the Winwedge.exe file installed on your system and also correct name of the WinWedge configuration file that you want to use. For example, if the Software Wedge is installed in the path “c:\program files\winwedge\winwedge.exe
” and the Software Wedge configuration file that you want to use is named “MyConfig.SW3
” then the batch file “Wedge.Bat
” should contain the line:
"c:\program files\winwedge\winwedge.exe" MyConfig.sw3
If you do not have the Instsrv.exe and Srvany.exe files, click here to download them in a self extracting ZIP file along with a sample Wedge.Bat batch file.
To run WinWedge as a Service
- Cick on Start > Run and type
Instsrv Wedge C:\Service\Srvany.exe
(Where “Wedge” will be the name of the Service).
- Click Services in Control Panel, (under Administrative Tools in Windows 2000). Click on the service “Wedge” and then click Startup to display the startup dialog box. There click Automatic. In the Logon On as… box, choose Local System Account. Mark the checkbox: Allow service to interact with desktop.
- Start Registry Editor using Regedit.
- Add a new subkey called Parameters in the following registry location:
HKEY_Local_Machine\SYSTEM\CurrentControlSet\Services\Wedge
- In the new Parameters subkey create the following String Entry (REG_SZ) with its value:
Application Type:REG_SZ Value: "C:\Winnt\system32\cmd.exe"
- In the Parameters subkey create an AppParameters Value Entry with a data type of REG_SZ and specify:
Application Type:REG_SZ Value: "c:\service\wedge.bat"
- In the Parameters subkey create an AppDirectory Value Entry with a data type of REG_SZ and specify the location of the WinWedge directory. For example:
Application Type:REG_SZ Value: "c:\program files\winwedge"
- Add a new subkey called Parameters in the following registry location:
- Start the newly created service manually, or reboot to activate the changes.