Protein Production
293FT, 293E, CHO

Truly Functional Protein
95% Purity
1-10 mg in 2 weeks

GeneExpressoMax™
293Expresso™

Transfection Reagents
* 90% Efficiency
* 95% Viability
* No sera interference
* Simple protocol
* High-throughput
* Only $98/ml

Baculovirus
Functional Protein
95% Purity
Fast turnaround
1-10 mg from Sf9 cells

Adenovirus, AAV
& Lentivirus

ORF or shRNA
* High Titer
* Cre, FLP, ΦC31
* Protein Kinases
* Transcription Factors
* Luciferases, GFP, RFP
* Protein Production
* Stable Cell Line


Excellgen

Use perl script to mange windows service: get status, start, stop and restart a Windows service

If you want to use Perl script and windows scheduler to stop, start, restart a service at specific time, here is a script (based on Win32::OLE) you can use:

use Win32::Service;
use Win32::OLE;
my $hostName= $ARGV[0];
my $serviceName=$ARGV[1];
my $command =$ARGV[2];
my $command2 =$ARGV[3];

if ($#ARGV <2)
{
print "Usage: $0 hostName serviceName command[stop|start|restart|start_if_not_running] command2 \n";
exit (0);
}

%status =(1 => 'STOPPED',
2 => 'START_PENDING',
3 => 'STOP_PENDING',
4 => 'RUNNING',
5 => 'CONTINUE_PENDING',
6 => 'PAUSE_PENDING',
7 => 'PAUSED',
8 => 'ERROR');

$ADsPath = "WinNT://$hostName/$serviceName,service";
$s = Win32::OLE->GetObject($ADsPath) or die "Unable to retrieve the object for $ADsPath\n";
print $hostName ." | ". $serviceName .": ". $status{$s->{status}} . "\n";

my $cur_status = $status{$s->{status}};
if ( $command eq "stop")
{
$s->Stop();
}
if ( $command eq "start")
{
$s->Start();
}

if ( $command eq "restart")
{
$s->Stop();
sleep(60);
$s->Start();
}

if ( $command eq "start_if_not_running" && $cur_status ne 'RUNNING' )
{
$s->Start();
}

sleep(30);

$cur_status = $status{$s->{status}};
print $hostName ." | ". $serviceName .": ". $cur_status . "\n";

$hostName=lc($hostName);

if ($hostName eq "localhost")
{
if (($command eq 'start' || $command eq 'restart' || $command eq 'start_if_not_running') && $cur_status ne 'RUNNING')
{
my $command="net start $serviceName";
system($command);
}
if ($command2 ne "" && $command ne "stop")
{
sleep(30);
system($command2);
}
}

Tags:

March 5, 2007 at 4:23 pm

1 Comment »

  1. efultz said,

    June 4, 2007 @ 11:37 am

    Is this script able to be run from a Linux box to manage a Windows service?

RSS feed for comments on this post · TrackBack URI

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Sponsored Links Excellgen http://www.labsupplymall.com

Recombinant Lentivirus & Adenovirus
High Yield and High Titer up to 1010 (lentivirus) and 1013 (adenovirus) for Guaranteed Expression of GOI. $3000, $2500
Transient Protein Expression in CHO and HEK293 Cells
Transient Expression, Truly Functional Protein, 95% purity, 1~20 mg, fast turnaround. $5500, $3950
Baculovirus Protein Expression
Fast turn around, >95% purity functional protein. No outsourcing to China or India. $5500, $3950