473,387 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Application Error

Hi All,

I am getting "myexe - Application Error"
I wan to write a sctipt to termicate the exe when ever my system triggers Application error and start again, I have the scrip to terminate the exe and start it. But i am unable to write the scrip to capture the "myexe - Application Error".

here is the script I am using for Terminating and starting the exe.
------------------------------------------------------------------------------------------------------------------
'Terminate the exe
for each Process in GetObject("winmgmts:{impersonationLevel=impersonat e,(Debug)}").InstancesOf("win32_process")
If Process.Name = "MyExe.exe" Then
Process.Terminate Process.ProcessID
MsgBox "Process terminated"
End If
next


set process = GetObject("winmgmts:{impersonationLevel=impersonat e}!Win32_Process")
set list = getobject("winmgmts:")_
.execquery("select * from win32_process where name='MyExe.exe'")
If list.count > 0 Then
Wscript.Echo list.count & " MyExe.exe running"
Else

' Wscript.Echo "Application not running"
result = process.Create ("D:\MyExe.exe")

End If

------------------------------------------------------------------------------------------------------------------

Can some one please help me how to capture that error.

Thanks,
Phani
Nov 9 '07 #1
1 1211
by the look of the codeing, it looks like you are using visual basic or visual studio. if you are, then this might help:


public sub blah()
on error goto 123

[codeing]

goto 234

123
end

234
end sub


put this in the public and private parts of your code and it will terminate the program if any error occurs.

i hope this helps ya
Apr 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Cenray | last post by:
How to generate a web request from a Winform Application using a WebService? In a C# Windows Application, when I try to genrate a web request using the following code, it is woking fine ...
0
by: Rhon Stewart via DotNetMonster.com | last post by:
Hi please visit this link : http://www.eggheadcafe.com/articles/pfc/selfupdater.asp I followed all the steps for listed on the link , when I execute the application it it gives me the following...
6
by: Javier Cortés Cortés | last post by:
i am getting this error when i am trying to access any file(with the ext. aspx) from my remote server. the error is : Server Error in '/' Application....
1
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
3
by: Matthew Louden | last post by:
My ASP.NET application is running without error in my local machine (IIS PWS). However, once I upload all the ASPX files to the remote IIS machine with Windows Server 2003 OS, it no longer works. ...
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
4
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the...
9
by: Wayne Wengert | last post by:
I built an ASP application and it runs fine on my local IIS. I am trying to move the application to my web service (ISP) out on the internet. I've read several of the help articles but they all...
3
by: Sean | last post by:
HI There, I am having trouble deploying my .aspx pages to a remote server, I have made changes to the config file and it still returns an error. I have also contacted the server administrator to...
2
by: saggydel | last post by:
I have 3 web application these all are independent to each other. 1 web application have .aspx, .aspx.cs, web.config, .dll and some other Supporting files. I want to make a common setup of all 3...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.