Marcus Posted September 8, 2005 Posted September 8, 2005 Hello Folks! Here's another "simple stumper" 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]
GaryFrost Posted September 8, 2005 Posted September 8, 2005 (edited) Edit: might be able to to do a winexists on it. Edited September 8, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
AutoChris Posted September 8, 2005 Posted September 8, 2005 Hello Folks!Here's another "simple stumper" While ProcessExists("Command.com") ProcessClose("Command.com");clean up any residual command prompt instances before moving on... WEndThis 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.
Marcus Posted September 8, 2005 Author Posted September 8, 2005 @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]
MHz Posted September 8, 2005 Posted September 8, 2005 @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.
Marcus Posted September 8, 2005 Author Posted September 8, 2005 @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]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now