Start Command Prompt with layout options?


J

J.F. Kelley

I have some "dos" apps I'd like to start in a window with
my preferred rows and columns. I know how to manually
use the menus to customize my Command Prompt launch icon,
but don't know how to do a Start in a Batch file to get a
new window with those options in effect.

Do you?

J.F. Kelley
 
Ad

Advertisements

P

Phil Robyn

J.F. Kelley said:
I have some "dos" apps I'd like to start in a window with
my preferred rows and columns. I know how to manually
use the menus to customize my Command Prompt launch icon,
but don't know how to do a Start in a Batch file to get a
new window with those options in effect.

Do you?

J.F. Kelley
Use the menus to make a LNK shortcut to start each DOS app,
then START each LNK file.
 
J

J.F. Kelley

Thank you, but that was the first thing I tried. I have
a "Command Prompt.lnk" icon on my desktop. I have used
the manual options to make that a 60-line window. When I
double-click that lnk icon, I get what I want.

However, when I create a batch file that says:

START "c:\Documents and Settings\myid\Desktop\Command
Prompt.lnk"

It starts a command prompt with the default layout. If I
just name the lnk file, it runs in the current window
(i.e., doesn't start a new window).
 
P

Phil Robyn

J.F. Kelley said:
Thank you, but that was the first thing I tried. I have
a "Command Prompt.lnk" icon on my desktop. I have used
the manual options to make that a 60-line window. When I
double-click that lnk icon, I get what I want.

However, when I create a batch file that says:

START "c:\Documents and Settings\myid\Desktop\Command
Prompt.lnk"

It starts a command prompt with the default layout. If I
just name the lnk file, it runs in the current window
(i.e., doesn't start a new window).
OK, have you tried making *.PIF files instead of *.LNK files
and starting the *.PIF file for each DOS app?

Here's an actual example from my system:

===== begin file c:\CMD\TEST\HEXTABLE.CMD =====
1. @echo off
2. echo >c:\batch\autowyl.bat @echo off
3. echo>>c:\batch\autowyl.bat c:\wylbur\wylbur.exe /A 8192 /D /E c:\wylbur\ntlib\cmdinit.wyl parm="c:\wylbur\tlib\makehtb1.wyl"
4. start c:\cmd\util\NT2WYL~1.PIF
5. goto :EOF
6. :EOF
===== end file c:\CMD\TEST\HEXTABLE.CMD =====

The preceding creates c:\batch\autowyl.bat (with the detailed information
to pass to wylbur.exe, in this case, telling wylbur what file to execute
[c:\wylbur\tlib\makehtb1.wyl, which displays a table on the screen of the
hex values of *all* characters from 0 to 255, screen print upon request)
and then invokes the 'DOS' application (wylbur.exe) by STARTING the PIF
file c:\cmd\util\NT2Wylbur.PIF, which in turn invokes the just-created
c:\batch\autowyl.bat, which in turn launches wylbur.exe and tells it what
wylbur exec program (equivalent to a batch file) it is supposed to execute.

So, at the CMD prompt, I type 'hextable', which causes another 'DOS'
window to open, displaying the hex table along with the message
 
D

David Trimboli

If you wanted to run program.exe in a window of 80 columns and 40 lines,
create a batch file (let's call it launchmyprogram.cmd)with the following
commands:

mode con cols=80 lines=40
program.exe

Then, to start the program this way from another batch file use the command

start launchmyprogram

To run the program from a command prompt, you can leave off the "start".

Add in any appropriate or necessary paths, of course.

I don't think you can do it from a single batch file, because I think you
can only "start" or "cmd" a single program. (I've tried using "&" to run
more than one program after a "cmd", but it doesn't work.)

David
Stardate 3878.4
 
Ad

Advertisements

D

David Trimboli

I stand corrected (by myself!). You CAN do it in a single command:

start cmd /k (mode con cols=80 lines=40 ^& program.exe)

It occurred to me that an escape character might make the & work right . . .
..

Now just change to your own parameters and you've got it!

David
Stardate 3878.6
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top