-
Junior Member
Close Command prompt using Vbscript
How to close the Command prompt using Vbscript
Using batch file i am opening the any application by mentioning the path but that application is opening along with command prompt also showing. please let me know how to close the command prompt not an application
-
Moderator
Re: Close Command prompt using Vbscript
Try this:
Sub cmdClose()
Dim oCMD
Set oCMD=GetObject("WSCript.shell")
oCMD.Close
Set oCMD=Nothing
End Sub
-
Expert Member
Re: Close Command prompt using Vbscript
hei it is not working in my machine...I have XP...
-
Expert Member
Re: Close Command prompt using Vbscript
it is giving a runtime error..
-
Junior Member
Re: Close Command prompt using Vbscript
Friends,
This works for me on using it after writing the script for closing all the unwanted application. Let me know, for your testing it helps or not. I am waiting...
Set oShell = CreateObject("WScript.Shell")
Set oWmg = GetObject("winmgmts:")
strWndprs = "select * from Win32_Process where name='cmd.exe'"
Set objQResult = oWmg.Execquery(strWndprs)
For Each objProcess In objQResult
intReturn = objProcess.Terminate(1)
Next
Last edited by ravisuriya; 01-17-2008 at 02:06 AM.
-
Expert Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules