Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Opening and Close Application from Vb.net

Status
Not open for further replies.

PRUSA

Technical User
Sep 23, 2004
35
US
Hi Everyone,

I'm new to vb.net. I have been trying to learn some vbscript, and I guess its somewhat making sense. I'd rather use vb.net, just cause of the form functionaility, and cause it produces and .exe file which i reallly want..

My question is: What is the best way of opening an closing a application from vb.net?

This is what i'm using to open a txt file in vbscript:
Dim wojbect
Set wobject = CreateObject("WScript.Shell")
wobject.Run "C:\test.txt", 1

and this is what I'm using to close that file:
wobject.Run("taskkill /F /IM notepad.exe /T")

Is this the only way to open and close a application?
another thing I noticed when I use the taskkill command from vbscript, and lets say I close an application that has an icon on the systemtray the icon does not disappear unless I hover my mouse over the icon.

For example lets say i use my process to open up taskmgr.exe twenty and close it twenty times. All the icons will continue to remain on my systemtray until I move my mouse over the icons. Does anyone know how to fix this aswell??

Any help on this would be musch appreciated, thanks in advance.

-Thanks
Sergio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top