← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #182144]: App.open problems with cmd.exe

 

Question #182144 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/182144

    Status: Open => Answered

RaiMan proposed the following answer:
tested on my Win7 32:

In an open command line window when giving the command "cmd", does
generally not open a new command line window, but a sub session inside
the current command line window. Both sessions share sys in and sys out
(the printouts of both sessions get mixed up).

So this approach will not be successful when running the script from
command line, if the intention is, to have a separate command line
window.

You can use the start command to achieve what you want:

cmdPath = os.getenv("comspec")
title = "My Command Line"
cmd = 'start "%s" %s'%(title, cmdPath)
os.popen(cmd); wait(3)

this opens an extra command line window with the window title given with
the title string, so you can focus on this window subsequently. This
works in IDE and running from command line.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.