Home All Groups Group Topic Archive Search About

shell command in windows service doesn't execute

Author
15 Apr 2005 9:30 AM
BROQ
Hi,

I am using a windows service to extract every hour a log from our
mailserver in order to parse the logfile.
To do this I used the folowing code:

Shell("""C:\pscp"" -pw *******
mgm@192.168.1.240:/var/log/qmail/current
C:\_var_log_qmail_current.txt", AppWinStyle.MaximizedFocus)

I know the """ isn't needed but i added them for testing reasons.
So what happens: nothing. The shell command doesn't get executed.
I did some help lookup and tried to test with the windows example:

Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus)

And even this one doest work.
I try-catched it and debugged with the service debugger, but there are
no errors on that line.
Anyone knows what the problem could be?

I have this import: Imports Microsoft.VisualBasic

Tnx a lot !

Author
15 Apr 2005 9:55 AM
JohnFol
What happens when you do this and put a break point on the catch?

Try

Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus)

Catch ex As Exception

End Try







Show quoteHide quote
"BROQ" <christophe.br***@gmail.com> wrote in message
news:295da4e5.0504150130.76fd5e9f@posting.google.com...
> Hi,
>
> I am using a windows service to extract every hour a log from our
> mailserver in order to parse the logfile.
> To do this I used the folowing code:
>
> Shell("""C:\pscp"" -pw *******
> mgm@192.168.1.240:/var/log/qmail/current
> C:\_var_log_qmail_current.txt", AppWinStyle.MaximizedFocus)
>
> I know the """ isn't needed but i added them for testing reasons.
> So what happens: nothing. The shell command doesn't get executed.
> I did some help lookup and tried to test with the windows example:
>
> Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus)
>
> And even this one doest work.
> I try-catched it and debugged with the service debugger, but there are
> no errors on that line.
> Anyone knows what the problem could be?
>
> I have this import: Imports Microsoft.VisualBasic
>
> Tnx a lot !