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

FIND:Invalid Switch

3,316 views
Skip to first unread message

REDFISH

unread,
Jun 23, 2000, 3:00:00 AM6/23/00
to
When I execute the following line from an NT Workstation,

IF EXIST c:\autoexec.bat type
c:\autoexec.bat|find /v/i "c:\banner.exe">c:\tempban.bat

I receive this error onscreen:

The process tried to write to a nonexistent pipe.

This is written to the tempban.bat file:

FIND:Invalid Switch

additional info:

* an autoexec.bat file exists but doesn't include
the "c:\mcbanner.exe" string.

** tempban.bat doesn't exist prior to executing the batch file

tempban.bat doesn't exist.

What's wrong here???

Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com


Clay Calvert

unread,
Jun 23, 2000, 3:00:00 AM6/23/00
to
REDFISH <joneslw...@mcrdpi.usmc.mil.invalid> wrote in message
news:2bb114b0...@usw-ex0104-028.remarq.com...

> When I execute the following line from an NT Workstation,
>
> IF EXIST c:\autoexec.bat type
> c:\autoexec.bat|find /v/i "c:\banner.exe">c:\tempban.bat

Put a space between the /v and the /i, and also you probably want a space on
either side of the pipe "|".

Frank-Peter Schultze

unread,
Jun 23, 2000, 3:00:00 AM6/23/00
to
"REDFISH" <joneslw...@mcrdpi.usmc.mil.invalid> schrieb im
Newsbeitrag news:2bb114b0...@usw-ex0104-028.remarq.com...

> When I execute the following line from an NT Workstation,
>
> IF EXIST c:\autoexec.bat type
> c:\autoexec.bat|find /v/i "c:\banner.exe">c:\tempban.bat
> [...]

Very interesting: you have only to put a space between the two
find-switches...

IF EXIST c:\autoexec.bat type c:\autoexec.bat|find /v /i
"c:\banner.exe">c:\tempban.bat

HTH, Peter

BTW post your NT/2K related batch question to news:alt.msdos.batch.nt

--
Frank-Peter Schultze, http://www.fpschultze.de
Permanent Mail: mailto:fpsch...@bigfoot.de

Georg Pohl

unread,
Jun 24, 2000, 3:00:00 AM6/24/00
to

"REDFISH" <joneslw...@mcrdpi.usmc.mil.invalid> schrieb im Newsbeitrag
news:2bb114b0...@usw-ex0104-028.remarq.com...
> When I execute the following line from an NT Workstation,
>
> IF EXIST c:\autoexec.bat type
> c:\autoexec.bat|find /v/i "c:\banner.exe">c:\tempban.bat
>
> I receive this error onscreen:
>
> The process tried to write to a nonexistent pipe.
>
> This is written to the tempban.bat file:
>
> FIND:Invalid Switch
>
> additional info:
>
> * an autoexec.bat file exists but doesn't include
> the "c:\mcbanner.exe" string.
>
> ** tempban.bat doesn't exist prior to executing the batch file
>
> tempban.bat doesn't exist.
>
> What's wrong here???


AFAIK: if questions don't like pipes:

if condition type files | find /v/i "text"

It is not the space or not space between /v and /i. Intead of this try:

set ae=c:\autoexec.bat

if exist %ae% type find /v/i "banner.exe" < %ae% > c:\foo.bar

HTH
Georg Pohl
--
Email: Pohl...@compuserve.de
Website: http://www.online-club.de/~Eulenspiegel
Freeware for DOS/Windows, C-Libraries

Georg Pohl

unread,
Jun 27, 2000, 3:00:00 AM6/27/00
to
Georg Pohl schrieb in Nachricht <8j2vvl$ec6$2...@news.rp-plus.de>...
[...]

>AFAIK: if questions don't like pipes:
>
> if condition type files | find /v/i "text"
>
>It is not the space or not space between /v and /i. Intead of
this try:
>
>set ae=c:\autoexec.bat
>
>if exist %ae% type find /v/i "banner.exe" < %ae% > c:\foo.bar
[..]


Real good old nonsense !!!
It sould be:

if exist %ae% find /v/i "banner.exe < %ae% > c:\foo.bat

Sorry for this mistake

Georg Pohl

0 new messages