Jump to content

Detecting the Presence of Command.com?


Marcus
 Share

Recommended Posts

Hello Folks!

Here's another "simple stumper" :P

While ProcessExists("Command.com")
    ProcessClose("Command.com");clean up any residual command prompt instances before moving on...
WEnd

This doesn't work, of course, because the command prompt is not an exe.

However, this begs the question: How can we close an ad hoc instance of Command without looking at the title of the window?

Would be nice if the "process" itself was detectable...

;)

Any ideas???

Thanks!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

Hello Folks!

Here's another "simple stumper"  :P

While ProcessExists("Command.com")
    ProcessClose("Command.com");clean up any residual command prompt instances before moving on...
WEnd

This doesn't work, of course, because the command prompt is not an exe.

However, this begs the question: How can we close an ad hoc instance of Command without looking at the title of the window?

Would be nice if the "process" itself was detectable...

;)

Any ideas???

Thanks!

<{POST_SNAPBACK}>

Just curious: Is there are reason you are using command.com rather than cmd.exe? At least with cmd.exe you can see the process and therefore close it.
Link to comment
Share on other sites

@gafrost:

Nope. WinExists() is a bomb for Command and Command.com.

Makes sense; as this is not the window's title.

Wanted to detect the process level here; if it's possible ;)

@SerialKiller:

Both Cmd.exe and Command.com now exist peacefully in the System32 directory. Need to secure both of the little monsters; not just Cmd...

Thanks!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

@gafrost:

Nope.  WinExists() is a bomb for Command and Command.com.

Makes sense; as this is not the window's title.

Wanted to detect the process level here; if it's possible  ;)

@SerialKiller:

Both Cmd.exe and Command.com now exist peacefully in the System32 directory.  Need to secure both of the little monsters; not just Cmd...

Thanks!

<{POST_SNAPBACK}>

This works for me. No title change option for command.com?

Opt('WinTitleMatchMode', 2)
If WinExists('command.com') Then WinClose('command.com')

ProcessClose is not available for command.com. As you did not state a 9x system, then %ComSpec% is what you call from bat/cmd files and @ComSpec from AutoIt scripts. That means CMD.exe gets used.

Link to comment
Share on other sites

@MHz:

Complete bomb on both

Opt('WinTitleMatchMode', 2)
If WinExists('command.com') Then WinClose('command.com')

and

While WinExists("Command")
    WinClose("Command") 
WEnd

No close!

Sure, we can close the console window if we work the titlebar. No problem!

-- BUT --

I wanted to know if there was some trick to finding out when an instance of the .com file is launched; and then do away with it from that lower-level approach instead.

Curious...

;)

Is this possible in v3???

Thanks!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...