Just starting out? Need help? Post your questions and find answers here.
zikitrake
Addict
Posts: 879 Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain
Post
by zikitrake » Thu Apr 23, 2009 7:47 am
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!
ts-soft
Always Here
Posts: 5756 Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany
Post
by ts-soft » Thu Apr 23, 2009 7:51 am
your both codes doesn't work!
I would think, use this:
Code: Select all
RunProgram(GetEnvironmentVariable("COMSPEC"), "/k " + MyCmd + " " + MyParams, "")
This works
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.
zikitrake
Addict
Posts: 879 Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain
Post
by zikitrake » Thu Apr 23, 2009 7:59 am
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
My code works in (my) Window XP
But your code is more useful for anothers systems! it's works fine
Thank you!
PS: It's for
AL90's PureFileMaster