[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Batch files in Windows.



[Robert H. Kubie:]

>I have now been running various versions of Windows for years, but have
>never learned if there is a Windows equivalent to a DOS batch file. I
>suspect that everybody else in the world knows the answer to that question,
>but I don't.
>
>Will somebody kindly put me out of my misery? Is there? What is it?

   I'm not sure if there's a general feeling that silence on this list for
many months takes away my right to suddenly come in again - but you can have
ordinary DOS-style batch files in Windows, and run them from the DOS prompt. I
think there is also a facility for starting them within Windows (as against a
DOS box). You can include commands for at least some Windows programs, too,
although you may have to Alt-Tab back to the DOS window to continue running it.
I have constructed several quite complex ones, up to 70 or so Kb., with menus
and submenus included.
I did this because I got sick and tired of either typing very long Windows file-names at the DOS prompt, or navigating my way through nested subdirectories in the "Open file" facilities of certain Windows programs. I love being able to do lots of things by a single keystroke, and batch files can enable that. Alas,
those days of efficient keyboard interfaces seem to be gone now.
Is that what you meant? If there is something specifically Windows-based,
not using a DOS command line, then I haven't found it.
   To be sure, I haven't especially tried to. I am one of those Windows
haters, who got trapped in Windows by adopting it before fully realizing what a horror I was dropping myself into. It doesn't agree with XyWrite, which is why
(very sadly) I have not followed through with my earlier plans to use XyWrite
all the time.
I'm so fed up now that I am seriously planning to switch to Linux. I don't
know if XyWrite will be usable there or not. I hope so, but suspect not.
   (Can anyone answer that?)

             Regards,
             Michael Edwards.
My experience is similar. He has it right.
I have a large collection of batch files that I have moved from machine to machine--DOS to OS/2 (change the file extension to .cmd) and to Windows (extension back to .bat). The DOS window in Windows is not as good as DOS itself nor the command interpreter in OS/2 which may have been the best I have used. The ansi.sys allowed different colored windows which was handy for keeping work straight. It was also more robust and configurable than that thing Windows has. DRDOS was right good, too.
I keep the bat files in a \bats directory on one of the drives (never, ever
c:\). The only complication I have found is resetting the path statement to
include that directory. Windows treats the path differently seemingly in
every version and even with different reinstalls on the same machine. If I
am permitted to alter whatever file sets the path--assuming I can figure it
out--I am in business because I have now taught Windows what it needs to
know so I can use it. If not, when I shell out, I run p.bat (ie path) which
sits on the root of c:\ and that resets the path to include the bats
directory and the XyWrite directory. p.bat is different on every machine
because configuration varies. However, when Windows gets the path wrong so
you need a p.bat (or its equivalent) when you shell out to DOS in XyWrite,
the new DOS shell window now goes back to the default path so the bat files
now don't work. It is probably figureable outable but I just don't want to.
Having used bat files and worked on the command line for a number of years,
I know all my oldies--some almost 20 years old--and I add them when I need
them. For instance, I now have pf.bat which changes to the Program Files
directory--that space is a killer so you put the quote in, et voila. I
write what I might call "nonce" bat files for something with long file
names or when necessary for other reasons, attach.bat takes me to Eudora's
attachment directory which is sometimes waaaay down in subsubsub directories.
Oldies: c.bat (that is, type the letter c and hit enter) always takes me to
the root of c:\, b.bat takes me back one directory and so forth. My best
bat file, though, is x.bat:
@echo off
exit

To close a window.

More complex is dold.bat (give me the directory sorted oldest to newest):
@echo off
dir %1 %2 %3 %4 %5 /o:d

And dnew, dbig, dsmall, etc. etc. And, of course, xy. So, I hit:
Control + Alt + D takes me to DOS from Windows
p [enter] -- when necessary
xy [enter]
And I am in XyWrite.
I also match some of the bat files to the keyboard shortcuts. Control + Alt + D opens a DOS window in Windows. In XyWrite, it shells out to DOS. One thing that makes great programs great is that you teach it the way you think, you don't have to learn the way a bunch of programmers think...if "think" is the right word for it.
Another advantage of Mac, I find, as I am switching, too, is that I can
write shell scripts to do the same thing as the bat files I have been
lugging around for over 20 years. So, I can reuse them and teach Unix the
way I have thought for the last 20 years..er...if "thought" is the right
word for it.
Bob Molyneux
drdata@xxxxxxxx