better command line environment?

S

Spoon2001

I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like XXCOPY, a
command line can get pretty long.

The command-line is a very inflexible and unforgiving thing, when you are
typing the darned thing in.

Just for example, saying you are typing in a command that spans over one
line. You want to make a correction on the first line, and so, quite
naturally, you hit the up key. Whoops! You just wiped out the whole
command line you just constructed, and now you see the command line you ran
before.

What I'd like is a utility that:
(1) lets you type in a command line in a box, and lets you use all the usual
word-processing keystrokes to edit that command line before you execute it;
(1a) maybe it could even let you put in line breaks for extra readability
before you execute the thing - where have I seen this before - maybe just in
programming languages;
(2) makes it easy to save and recall command lines you've typed in before;
(3) makes it easy to view and save the entire output of command.
(4) full of neat features I can't think of at this time of night.
 
D

DC

Spoon2001 said:
I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like XXCOPY, a
command line can get pretty long.
The command-line is a very inflexible and unforgiving thing, when you are
typing the darned thing in.
Just for example, saying you are typing in a command that spans over one
line. You want to make a correction on the first line, and so, quite
naturally, you hit the up key. Whoops! You just wiped out the whole
command line you just constructed, and now you see the command line you ran
before.
What I'd like is a utility that:
(1) lets you type in a command line in a box, and lets you use all the usual
word-processing keystrokes to edit that command line before you execute it;
(1a) maybe it could even let you put in line breaks for extra readability
before you execute the thing - where have I seen this before - maybe just in
programming languages;
(2) makes it easy to save and recall command lines you've typed in before;
(3) makes it easy to view and save the entire output of command.
(4) full of neat features I can't think of at this time of night.

Sounds like you want bash for linux.

Hmmm...waitaminnit...

<clickety>

Bash for Windows -- well, whaddya know! }:O)

http://www.steve.org.uk/Software/bash/
 
R

Roger Johansson

Spoon2001 said:
I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like XXCOPY, a
command line can get pretty long.

The command-line is a very inflexible and unforgiving thing, when you are
typing the darned thing in.

Just for example, saying you are typing in a command that spans over one
line. You want to make a correction on the first line, and so, quite
naturally, you hit the up key. Whoops! You just wiped out the whole
command line you just constructed, and now you see the command line you ran
before.

What I'd like is a utility that:
(1) lets you type in a command line in a box, and lets you use all the usual
word-processing keystrokes to edit that command line before you execute it;
(1a) maybe it could even let you put in line breaks for extra readability
before you execute the thing - where have I seen this before - maybe just in
programming languages;
(2) makes it easy to save and recall command lines you've typed in before;
(3) makes it easy to view and save the entire output of command.
(4) full of neat features I can't think of at this time of night.

That's why we have batch files.

Use your favorite text editor, Metapad or UltraEdit for example, write the
command line(s), name the file xxxxx.bat, run the file.
(Good editors have the ability to run the file you are writing on, in some
menu, or as tools the user can define, or as a keyboard shortcut.)
Save it so you don't have to write it again, just click on the bat file
instead.

After you have run a bat file you can find a .pif file in the same
directory with the same name as the bat file, xxxxx.pif.
Right-click on that pif file and choose properties, you can set how this
bat-file is to be run, some details about fonts, fullscreen or window,
etc..

A good file manager is your best friend, 2xExplorer, Total Commander, some
other norton commander clone, etc..
 
R

Roger Johansson

(3) makes it easy to view and save the entire output of command.

For many programs, and batch files, you can redirect the output from a
program, so what should have been sent to screen is sent to a text file
instead.

Write the command like this:

example.bat > output.txt

This is also used in many text editors for programmers, to create an output
window, where you see the output from the program, redirected to a screen
in the editor-program.

So you can talk to DOS from your text editor, just like you can talk to
compilers of different programming languages.
A part of the screen is used to show the output from running the file in
its natural running environment, determined by its extension.
A .bat file is run in DOS, a .py file in a Python compiler, etc..
 
C

charles

I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like XXCOPY, a
command line can get pretty long.

Here is something you might try - CmdSh201 at
<http://tp.lc.ehu.es/jma/win95.html>.

From the description: "Any advanced user has a lot of command line
programs in her system, but if you do not use them very often it is not
always easy to remember the right option to do something. Cmd Line Shell
is designed to be a shell for any command line program."

It basically lets you create a gui interface for a command with multiple
options.
 
S

Spoon2001

Hi gang,

Just to let you know what kind of program I am thinking about -

QuickWin
http://www.codeproject.com/dialog/quickwin.asp

xplorer2 alpha
http://www.2xexplorer.com
(type in a $ followed by a console command; this brings up a window named
"console^2" just like the name of the program is xplorer^2)

These are pretty rudimentary implementations of what I'm talking about. If
there is anything out there that does the same thing, but is much more full
featured, please pass it on.
 
M

ms

Spoon2001 said:
Hi gang,

Just to let you know what kind of program I am thinking about -

QuickWin
http://www.codeproject.com/dialog/quickwin.asp
snip

These are pretty rudimentary implementations of what I'm talking about. If
there is anything out there that does the same thing, but is much more full
featured, please pass it on.

QuickWin is only available to "members".

Do you have a direct download URL?

Thanks

Mike Sa
 
K

Kan Yabumoto

Spoon2001 said:
I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like XXCOPY, a
command line can get pretty long.

The command-line is a very inflexible and unforgiving thing, when you are
typing the darned thing in.
<snip>

Let me give you my take on this issue. But, I can speak only for
XXCOPY.

If your command line gets very long, you need to prepare for possible
typing errors until you get it right. If you use Win9X, then, the
installation of DOSKEY is a MUST (in XP, it has a built-in command
line editor including the recall-previous-lines feature). But,
even the built-in text editor is so limited, you should use a text
editor such as NotePad.

Here's one possible scenario:

1. Open a DOS Box and make the current directory somewhere
convenient.

cd \windows

2. at the command line of the DOS Box, invoke Notepad

notepad runxx1.bat

If the "runxx1.bat" file does not exit, Notepad will display
a confirmation message box.

3. Inside Notepad, type your xxcopy command.

----------------------------------------------------------
xxcopy c:\windows\*.dll /S/LDTZ // list DLL files
----------------------------------------------------------

(Since this is a batch file, you may enter two or more
lines. Also, it is not limited to XXCOPY commands.)

After editing the line, make sure you save the newly edited
text by File > Save (or, type Ctrl-S).

4. Go back to the DOS Box (it's best you use both the
NotePad and DOS Box in the "Restore" mode (middle size
rather than full size windows so that both NotePad and
the DOS Box is side-by-side.

5. In the DOS Box, just run the batch file by typing the
batch file name to invoke it.

runxx1.bat

If you use %1, %2... inside the batch file, you can add
argument to the batch file.

If you make mistake, you can always re-edit the text inside
the NotePad window (and make sure you save it by Ctrl-S).
and run the batch file again.

I encourage you to make a useful batch file that can be used
later. If you do so, give a good name to remember. Then,
you should create a shortcut Icon in the desktop so that
in the future, you can just double click the icon.

Here's how.

1. Right-click at an empty area of the Desktop.
2. New > Short Cut and
3. type the batch file name (e.g., c:\windows\runxx1.bat )
4. Give whatever label to the Icon in the next step.
5. Click "Finish" and you will see an icon which is ready to
run the batch file you just edited.
6. (Assuming that you are in XP), inside the Icon's properties
sheet, you should adjust the DOS Box appearance such as
buffer dimension, size, font, color, etc.


==============

Let me show you a little more elaborate (but very useful)
technique using the XXCOPY command-file (/CF) feature.

1. Open a DOS Box.

2. Go to the convenient directory where you create XXCOPY
files. Here, I assume you go to c:\windows.

C:
cd \Windows

2. Run the next command to create an XXCOPY command file.

notepad MYBACKUP.XCF

Here, we are going to edit a file "MYBACKUP.XCF" (any file
name is fine --- I recommend the use of .XCF extension
which is XXCOPY's recommended command file name.

Now, this text file is intended to be run by the next
command:

xxcopy /CF:MYBACKUP.XCF

the /CF command accepts a filename which supplies the
command line text for the XXCOPY program command input.
The /CF (Command File) feature allows you to write
a very long command text (since XXCOPY may accept unlimited
number of exclusion items like /X:*.MP3 /X:c:\WINDOWS\ ...
it could become very long).

For a complete description of what's allowed in the command
file, see the following article:

http://www.xxcopy.com/xxcopy37.htm

In essence, the .XCF file is nothing but a regular text
file and the syntax is exactly the same as the XXCOPY
command line. That is, for a short command, the text
will look almost exactly like the batch file I talked
earlier except that the line does not start with XXCOPY.

3. After you finish editing the MYBACKUP.XCF file inside
NotePad, make sure that you save it (Ctrl-S) and then,
from the DOS Box (hopefully, you take my advise and you
now have a good looking, colorful DOS Box with your
favorite font). You are ready to run.

4. Run the XXCOPY command file directly by the following
command at the Dos Box.

xxcopy /cf:mybackup.xcf

In this case, this is not a batch file. You can run only
one job at a time.

5. Once you are happy with a good command file script, you may
again save it and set up an Icon for it on the Desktop.
In this case, the text for the shortcut is:

c:\windows\system32\xxcopy.exe /cf:mybackup.xcf /WE

Remember that this set up assumes that you have XXCOPY.EXE
in c:\windows\system32\ directory. Also, the command is
assumes that the "current directory" to run the command
is at c:\windows\ directory (where it can locate the
mybackup.xcf file). To set this condition for the icon,
you should right-click the icon and go to the properties
sheet and set the "Start in:" box with the intended
"current directory" (which will be c:\windows in this case).

(Note: the /WE switch guarantees that the XXCOPY screen remains
visible after it finishes the execution.)

A possible pitfall in doing this is where is the "current directory"
settings (Or, you can always spell out the fill path name for the
command file script (e.g., /CF:C:\mydir\mybackup.xcf).

Since the XXCOPY command file can use any number of lines,
you can spread the text more with lots of comments.

Here's a sample of an XXCOPY Command file (has a built-in
comments) ---- extracted from the XXTB #37 article.

script3.xcf
-----------------------------------------------------------
/*****************************************************
* *
* script3.xcf created 2002-05-05 *
* *
* This XXCOPY script carries out a daily *
* incremental backup operation from C: to E: *
* The E: drive may be made bootable as C:. *
* *
* Invocation: xxcopy /cf:c:\backup\script3.xcf *
* *
* Log file: c:\backup\script3.log *
* *
* Note: A command filename may have any extension. *
* We use .XCF (for Xxcopy Command File). *
* *
*****************************************************/
C:\ // source (the whole system disk)
E:\ // destination (mirror disk)

/clone // my favorite switch
/PZ0 // prompt killer (for /Z)
/ON:c:\backup\script3.log // create a log file
/Fo:c:\backup\script3.lst // save file list
/FM:dtzl // list file format control

// list of exclusions ------------------------------
/X:*.tmp // no temp files
/X:\Windows\*\cache*\ // cache files of any kind
/X:\*\cookies\ // cookies are junk food
/X:"c:\My documents\my pictures\2002-May// string split
\Susie's birthday\*.jpg" // into 2 lines

/*
A // sequence preceded by a non-blank character
allows you to logically connect two lines.
(This is a traditional C-like comment.)
*/

/EX:c:\backup\exclude.lst // you may use /EX inside
/CF:c:\backup\another.xcf // nestable (up to 8 levels)

:: An in-line comment may start by // or :: which ends
// at the end of the line.
-----------------------------------------------------------

==============

Anyway, anyone serious about using XXCOPY (or any command line
operation), you should always keep a few DOS Box open on the
desktop. I usually have three or four DOS Boxes at any given
time on my XP system. There is no reason to close them.

The fact that an application is a command-line program, there
is no reason for you to stay with the very limited command
line editor that comes with the DOS Box.

Kan Yabumoto
The Author of XXCopy
 
D

Dave

Spoon2001 put pen to paper and... uhh.. put fingers to keyboard and
typed:
I am wondering if there is a utility that makes it easier to use
command-line utilities. I know that when running a program like
XXCOPY, a command line can get pretty long.

The command-line is a very inflexible and unforgiving thing, when you
are typing the darned thing in.

Just for example, saying you are typing in a command that spans over
one line. You want to make a correction on the first line, and so,
quite naturally, you hit the up key. Whoops! You just wiped out the
whole command line you just constructed, and now you see the command
line you ran before.

What I'd like is a utility that:
(1) lets you type in a command line in a box, and lets you use all the
usual word-processing keystrokes to edit that command line before you
execute it; (1a) maybe it could even let you put in line breaks for
extra readability before you execute the thing - where have I seen
this before - maybe just in programming languages;
(2) makes it easy to save and recall command lines you've typed in
before; (3) makes it easy to view and save the entire output of
command. (4) full of neat features I can't think of at this time of
night.

How about this?
http://tp.lc.ehu.es/jma/win95.html

From the website:
CmdSh201.exe

* If you are a power user you probably use old DOS or new Win32
programs designed to be run from the command line where the corresponding
options are indicated. To start with, many file maintenance jobs are far
easier when using command line utilities and batch files. The "user-
friendly" way to do many simple tasks (comparing two directories or
copying to the disk the relevant modified files of you current programming
task, for instance) is boring and error prone. Unix-like filters also are
still very useful.
* Any advanced user has a lot of command line programs in her system,
but if you do not use them very often it is not always easy to remember
the right option to do something. Cmd Line Shell is designed to be a shell
for any command line program.
* It provides a common, easily configurable, GUI look to any program
which takes its options from the command line.
* It will help you to prepare the command line and launch the external
program. (You may also copy the command line to use it, say, form a batch
file.)
* You do not have to remember the syntax: the available options and
their use are displayed.
* You may easily search through your system for the input and output
files.
* Your favorite options may be set as new default.
* This program is designed to be used, for instance, with
o the Console utilities by the same author,
o the PostScript utilities included, for instance, in the
excellent free implementation of TeX by Christian Schenk: MiKTeX
o the epstool which comes with the last release of Ghostscript
and GSview
o many GNU utilities.


Should do the trick, I'd think?
 

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