Run As Service Utility

 

Application is designed to be installed as a service and monitor a folder for specific flags.

If the flag is created, utility will execute a predefined application.

 

The reason for such utility is to allow executing specific application with the elevated privileges without requirement for the end-user to type-in the administrative password as well as without such password to be visible anywhere.

 

XP and Windows 2003 has the RunAs option, to allow executing an application with the elevated rights. The requirement to type-in the password to do it was a problem for our environment. Hence this application was develped.

 

Besides XP and Windows 2003, it can also run on Windows NT and Windows 2000 which is an advantage.

 

CONFIGURATION

 

First, look through the configuration example, attached with the distribution:

 

Configuration syntax should conform to regular XML formatting rules.

 

<config>
<ServiceName>StartExplorer</ServiceName>
<ServiceDisplayName>Start Explorer As Service</ServiceDisplayName>
<RemoteDestinationPathFile>c:\TEMP\</RemoteDestinationPathFile>
<ExecuteOptions>-i -d </ExecuteOptions>

<Applications>

 

<Explorer>

<ApplicationFullPath>PUSHD "[ProgramFiles]\Internet Explorer\"

START "[ProgramFiles]\Internet Explorer\IEXPLORE.EXE"

</ApplicationFullPath>

</Explorer>

 

</Applications>

</config>

 

Note:

 

Anything that goes between: <ApplicationFullPath> and </ApplicationFullPath> will be exactly re-created in the command batch file, which will be used for execution.

 

When "RunAs Service" identifies the flag file, it will create a batch file with the content of <ApplicationFullPath> parameter and it will execute the batch file.

Batch file will be located under c:\temp, so make sure that this folder actually exists.

 

 

TEST

 

To test, run app.exe from the command prompt.

Check that the /examples subfolder is created with example of flag-creating batches.

Run the example batch. It should create a flag, expected by the application and the command, specified in the <ApplicationFullPath> parameter will be executed.

 

INSTALLATION

 

svc.exe -install

 

Use Service Control Manager and find the Service, that was just installed.

Change the user name to be the required user name with elevated privileges;

 

NOTE:

When the application will be executed, it will be running as the Service with configured user name.

If the user configured within the service does not have profile or printers or internet connection configured, the application requiring it will have to be configured.

 

UNINSTALL

 

svc.exe -remove

 

 

 

Click HERE to download binary (2.1 Mb), click HERE to download Perl source (1.0 Mb).

 

 

TROUBLESHOOTING

 

1) Check the config.xml file - Can you properly open it with Internet Explorer? If not - there is a spelling mistake.

 

2) Test application by executing app.exe from the command prompt and executing an example command batch file, or manually drop the flag into the "\cache" folder to call the application;

 

3) Check the <RemoteDestinationPathFile> configured folder and see if the command batch file was created there.

Check the command batch file and see if it executes the application properly;

 

4) Ask Forum

 

5) Send Message to Developer