MSI Factory 2.3

Service.Stop

Service.Stop

This is the first topic This is the last topic  

Service.Stop

This is the first topic This is the last topic  

OverviewExamples

Service.Stop (

string DisplayName,

string KeyName = "",

number WaitTime = 0 )

Example 1

Service.Stop ("Freeze", "");

Stops the service "Freeze".

Example 2

-- specify the service's display name and location

ServiceDisplayName = "Service1";

ServiceFilePath = "C:\\WINDOWS\\SERVICE1.EXE";

 

-- Stop the specified service

Service.Stop(ServiceDisplayName, "", 5);

 

-- Copy the replacement service exe

File.Copy(_SourceDrive.."\\SERVICES\\SERVICE1.EX_", ServiceFilePath, false, true, false, true, nil);

 

-- Start the service

Service.Start(ServiceDisplayName, "", nil);

Stops the specified service, replaces the exe file, and starts the service.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us