10-08-2010
Running perl script from a VB.NET windows service
Here is the snippet of the code that I'm trying to execute.
Stat of the service does not launch perl script. OnStop works fine. Please could you help here.
Public Class Service1
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
If Not Diagnostics.EventLog.SourceExists("vbMgr") Then
Diagnostics.EventLog.CreateEventSource("vbMgr", "Application")
End If
EventLog.Source = "vbMgr"
EventLog.WriteEntry("vbMgr service starting")
Dim oShell = CreateObject("WScript.Shell")
oShell.Run("cmd.exe /K perl c:\runtm.pl")
oShell = Nothing
'Shell("cmd.exe /K perl c:\runtm.pl ", AppWinStyle.MaximizedFocus)
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
If Not Diagnostics.EventLog.SourceExists("vbMgr") Then
Diagnostics.EventLog.CreateEventSource("vbMgr", "Application")
End If
EventLog.Source = "vbMgr"
EventLog.WriteEntry("vbMgr service stopped")
Dim oShell = CreateObject("WScript.Shell")
oShell.Run("cmd.exe /K echo > c:\\test.log")
oShell = Nothing
End Sub
End Class
Thanks,
Hansini
9 More Discussions You Might Find Interesting
1. Programming
Has anyone here written an MS compatible .NET service that is hosted and served from a UNIX server instead of a W2K server? I love programming and writing .NET services with Visual Studio.NET and C#, but there is a fundamental problem --the Win2k server itself. It is not near as reliable as Sun... (0 Replies)
Discussion started by: yeslekmc
0 Replies
2. Shell Programming and Scripting
Hi all,
Let me first start out by saying I'm a perl newbie and hope somebody can help, for the life of me I can't figure out why my script will not find and download a remote file via FTPSSL. What it's supposed to do is find the latest file named... (4 Replies)
Discussion started by: Styles
4 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
Need help configuring Active Perl on Windows Vista.
I am trying to install Active Perl on Windows Vista.
The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006
After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies
4. Shell Programming and Scripting
How can I tell, in a shell script, if a certain service is running? I know how to do this on the command line, but not in a script. Is an error thrown somehow that I can check?
Thanks. (6 Replies)
Discussion started by: daflore
6 Replies
5. Solaris
Hi All,
I need to call a unix script from windows bat file, please help if that can be done.
I cant install cygwin or putty or any other ssh on server.....!
do we have anything else? (8 Replies)
Discussion started by: fidelis
8 Replies
6. Shell Programming and Scripting
Hi,
I am using below piece of code to get the size of the remote file.
$ftp->cwd($destination) or $error=$ftp->message;
if(!$error)
{
$ftp->put($file) or $error=$ftp->message;
print "FTP size = \n";
... (3 Replies)
Discussion started by: FarooqOnline
3 Replies
7. Shell Programming and Scripting
forgive me if i am posting this question in wrong forum.
I have a rsync script that runs on one server for rsync with another server (both linux)
.
Now I want to get control of that script from my windows 7 machine. Means I want to run that script from my windows machine whenever i want... (1 Reply)
Discussion started by: HarryReid
1 Replies
8. Solaris
Hey everyone, so I recently installed sma and disabled snmpdx for system monitoring in Solarwinds on 7 Oracle servers running Solaris 10. It was running just fine until we had to shutdown all systems and power back up (hurricane). Since then I cannot get the sma service to start, it goes into... (4 Replies)
Discussion started by: Zeus18
4 Replies
9. Shell Programming and Scripting
Hi
I have created a PowerShell script which successfully checks whether windows service pgsql-9.2 is running.
I have tried to call that PowerShell script with a shell/bash script within a LINUX machine but have been unsuccessful.
Is there a way of a shell/Perl script to check whether a... (5 Replies)
Discussion started by: simpsa27
5 Replies
LEARN ABOUT CENTOS
ppi::statement::end
PPI::Statement::End(3) User Contributed Perl Documentation PPI::Statement::End(3)
NAME
PPI::Statement::End - Content after the __END__ of a module
SYNOPSIS
# This is normal content
__END__
This is part of an PPI::Statement::End statement
=pod
This is not part of the ::End statement, it's POD
=cut
This is another PPI::Statement::End statement
INHERITANCE
PPI::Statement::End
isa PPI::Statement
isa PPI::Node
isa PPI::Element
DESCRIPTION
"PPI::Statement::End" is a utility class designed to serve as a contained for all of the content after the __END__ tag in a file.
It doesn't cover the ENTIRE of the __END__ section, and can be interspersed with PPI::Token::Pod tokens.
METHODS
"PPI::Statement::End" has no additional methods beyond the default ones provided by PPI::Statement, PPI::Node and PPI::Element.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2011-02-26 PPI::Statement::End(3)