Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Easy Question

3 views
Skip to first unread message

l...@bounceit.net

unread,
May 11, 2001, 8:24:51 PM5/11/01
to
We need to modify an existing batch to check where it is.
We need to be able to know if it is the Y: drive (it will be in the root
of Y:)

Why? Cause we need to delete and re-establish directories and, if this
batch is started from a directory we wipe out, the system can not find
the batch. Yes - that will never happen if we are careful, BUT careful
is hard to be at 2AM:-((

TIA
LB

Phil Robyn

unread,
May 11, 2001, 8:34:26 PM5/11/01
to
l...@bounceit.net wrote:

c:\cmd>whereami
{since I don't have a Y: drive ...}
So c:\cmd\TEST\whereami.cmd is running from c:.
Now what?

c:\cmd>wyllist test\whereami.cmd
==========begin file c:\cmd\TEST\whereami.cmd ==========
001. @echo off
002. setlocal
003. set mydrive=%~d0
004. set whoami=%~f0
005.
006. if /i "%mydrive%" EQU "C:" (
007. echo {since I don't have a Y: drive ...}
008. echo So %whoami% is running from %mydrive%.
009. echo Now what?
010. )
011. endlocal&goto :EOF
==========end file c:\cmd\TEST\whereami.cmd ==========


l...@bounceit.net

unread,
May 12, 2001, 8:30:04 PM5/12/01
to

Thank You!

Time to display my NT ignorance.
What is .cmd file about?

LB

Clay Calvert

unread,
May 12, 2001, 9:50:52 PM5/12/01
to
On Sat, 12 May 2001 20:30:04 -0400, l...@bounceit.net wrote:

<snip>

>What is .cmd file about?
>
>LB

WindowsNT did not start out being a new version of Windows. It
actually was commisioned by IBM to be a new version of OS/2, if I
recall correctly. I think it was going to be called OS/2 LAN Manager.
Well, MS just decided to give this new operating system a "Windows"
front end, and that is one of the reasons that IBM and MS had a
falling out. CMD files are functionality no different from .BAT files
in NT. CMD is a batch file extension that OS/2 uses.

Clay Calvert
CCal...@Wanguru.com
Replace "W" with "L"

Phil Robyn

unread,
May 13, 2001, 4:04:47 AM5/13/01
to
l...@bounceit.net wrote:

In addition to Clay's excellent reply, I got into the habit of using .CMD
instead of .BAT because .CMD files are intended to be executed by
CMD.EXE and often will not work in non-NT DOS. When there was
only a single newsgroup, alt.msdos.batch, this was kind of a way to
indicate that the file was intended for use in WinNT only. If a non-NT
user saved the file as .CMD, it could not even be loaded by COMMAND
because COMMAND (in non-NT DOS) requires a .BAT file type. But
NT CMD.EXE really doesn't care whether the file type is .BAT or .CMD.

Phil Robyn

l...@bounceit.net

unread,
May 13, 2001, 7:25:04 AM5/13/01
to

Thank you Clay and Phil.

Of course the answer begets another Q <g>

Since the legacy production system runs under either straight DOS
(command) or NT DOS (cmd) is there a way for a batch file to determine
which is being used prior to calling for .cmd file (and blowing up inder
a "command" system).

TIA (again).

LB

Phil Robyn

unread,
May 13, 2001, 7:26:13 PM5/13/01
to
l...@bounceit.net wrote:

It doesn't matter in NT because COMMAND.COM simply calls CMD.EXE
to execute each command anyway. The 16-bit COMMAND.COM is not
real (non-NT) DOS; it is especially designed for NT.

>
> TIA (again).
>
> LB


l...@bounceit.net

unread,
May 14, 2001, 6:30:18 PM5/14/01
to

I respect you (highly!) but....
How come I can set the command.com version to act just as the
command.com does under 95/98 - including the ability to get a direct
print of a screen by hitting the Print Scrn key - whereas the cmd.exe
version just dumps my screen print to the clipboard and I have to screw
around to get hard copy? Also, I think there are things that cmd.exe
does that command.com can not do (including using .cmd files).

LB

Phil Robyn

unread,
May 14, 2001, 7:05:52 PM5/14/01
to
>

<<<<<<<<<SNNNNNNIIIIIIIPPPPPPPPP>>>>>>>>>

> > >
> > > Since the legacy production system runs under either straight DOS
> > > (command) or NT DOS (cmd) is there a way for a batch file to determine
> > > which is being used prior to calling for .cmd file (and blowing up inder
> > > a "command" system).
> > >
> >
> > It doesn't matter in NT because COMMAND.COM simply calls CMD.EXE
> > to execute each command anyway. The 16-bit COMMAND.COM is not
> > real (non-NT) DOS; it is especially designed for NT.
> >
> > >
> > > TIA (again).
> > >
> > > LB
>
> I respect you (highly!) but....
> How come I can set the command.com version to act just as the
> command.com does under 95/98 - including the ability to get a direct
> print of a screen by hitting the Print Scrn key - whereas the cmd.exe
> version just dumps my screen print to the clipboard and I have to screw
> around to get hard copy? Also, I think there are things that cmd.exe
> does that command.com can not do (including using .cmd files).
>
> LB

How come? I don't know; I'm not responsible for developing either the
version of COMMAND.COM for NT or CMD.EXE. You would have
to ask the people responsible for developing these beasties why they do
what they do and don't do what they don't do.... ;-)

Phil Robyn
Univ. of California, Berkeley


0 new messages