to keep opened a DOS console.

Just starting out? Need help? Post your questions and find answers here.
zikitrake
Addict
Addict
Posts: 879
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

to keep opened a DOS console.

Post by zikitrake »

Hi, a 'simply' question:

A best code to do this?:

Code: Select all

MyCmd.s = "dir"
MyParams.s = "c:\*.*"

;Method 1 (Keep DOS console active)
RunProgram("command.com", "/k " + MyCmd + " " + MyParams, "")

;Method 2
OpenConsole()
RunProgram("command.com", "/c " + MyCmd + " " + MyParams, "")
CloseConsole()
Thank you!
PB 6.21 beta, PureVision User
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

your both codes doesn't work!
I would think, use this:

Code: Select all

RunProgram(GetEnvironmentVariable("COMSPEC"), "/k " + MyCmd + " " + MyParams, "")
This works :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
zikitrake
Addict
Addict
Posts: 879
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Post by zikitrake »

ts-soft wrote:your both codes doesn't work!
I would think, use this:

Code: Select all

RunProgram(GetEnvironmentVariable("COMSPEC"), "/k " + MyCmd + " " + MyParams, "")
This works :wink:
:? My code works in (my) Window XP
:D But your code is more useful for anothers systems! it's works fine

Thank you!

PS: It's for AL90's PureFileMaster
PB 6.21 beta, PureVision User
Post Reply