Re: Please explain this code
Jainbrijesh,
Another way this can be done is by combining both ApplicationDir and ApplicationPath. For example:
strAppLocation=Environment(“ProductDir”) & “\samples\flight\app\flight4a.exe”
So, when you want to run the application, all you do is this:
SystemUtil.Run “flight4a.exe”, “”, strAppLocation, “open”
[B]Usage:[/B] SystemUtil.Run "NameOfFile", "Paramters", "FilePath", "OperationToBePerformed"
Just another way… well, the third statement basically invokes the application during run session using a SystemUtil.Run statement. SystemUtil.Run statement enables you to open or run any application from a given location. Similarly, you can use SystemUtil to also close applications like this:
SystemUtil.CloseProcessByName “explorer.exe”
Re: Please explain this code
Hi Anshoo,
What you have explained to Mr.jain is correct.
But You cannot close the application by using SystemUtil.Run
We can use
[COLOR="Red"]SystemUtil.CloseProcessByName[/COLOR]
For example...
[COLOR="Magenta"]SystemUtil.CloseProcessByName "Explorer.exe"[/COLOR]
_________________
Rajaputra
Re: Please explain this code
Rajaputra,
The application closes as you end the process. So it can be used to initiate as well as close an application.
Let's say, I have "iexplore.exe" as the process instead of "Explorer.exe". If I close "iexplore.exe" when a Browser is open, the process will close along with the Browser application.
[B]EDIT[/B]: Wait, it is SystemUtil.CloseProcessByName and NOT SystemUtil.Run CloseProcessByName. I was mixing things up.
Sorry for the confusion. I didn't realize what I had written until I went back to my post. I will edit it.