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

Changing PATH for executables

0 views
Skip to first unread message

pcmdc

unread,
Jul 26, 2002, 9:40:47 AM7/26/02
to
I have a folder called C:\BATCH that contains a bunch of .bat files that I
have written.

No matter where I am in the system, I want to be able to execute my .bat
files that are located in the C:\BATCH directory.

I tried using the PATH command at the C: prompt. I typed PATH
C:\BATCH:%PATH%

It appeared to append my C:\BATCH directory becuase when I typed the command
BATCH...it did appear there. However, when I tried to execute some of my
customized .BAT files....it couldn't find them.

I also noticed that the next time I started DOS....that the PATH to C:\BATCH
was no longer there.

Any help would be appreciated.

Ethan Winer, MVP

unread,
Jul 26, 2002, 11:43:07 AM7/26/02
to
> I also noticed that the next time I started DOS....that the PATH to
C:\BATCH was no longer there. <

Your PATH is probably set in AUTOEXEC.BAT. Simply edit that file to include
the additional path to your batch files.

Gabriele Neukam

unread,
Jul 26, 2002, 3:42:11 PM7/26/02
to
[This followup was posted to alt.msdos and a copy was sent to the cited
author.]

Hi pcmdc,

On that special day, pcmdc, (pc...@bigfoot.com) said...

> No matter where I am in the system, I want to be able to execute my .bat
> files that are located in the C:\BATCH directory.

If you don't want to edit your autoexec.bat, you can write on the command
line.

SET Path=%PATH%;C:\BATCH

That should do the job. HTH,


Gabriele Neukam

Gabriel...@t-online.de


--
"Mom, there is a spider in the bathroom!"
"Are you sure?" - "Yes!"
"How many legs has it got?"
"I can't tell - but they are all dangling from a thread!" (c): RL

Dan G

unread,
Jul 26, 2002, 5:31:43 PM7/26/02
to

"pcmdc" <pc...@bigfoot.com> wrote:
> I tried using the PATH command at the C: prompt. I typed PATH
> C:\BATCH:%PATH%
>
> It appeared to append my C:\BATCH directory becuase when I typed the
command
> BATCH...it did appear there. However, when I tried to execute some of my
> customized .BAT files....it couldn't find them.
>
> I also noticed that the next time I started DOS....that the PATH to
C:\BATCH
> was no longer there.


Don't change your path spec from a DOS window. When you open a DOS window,
it gets a *copy* of the DOS environment, and your path manipulation is only
affecting that DOS session, which disappears when you close the window.

To make your change stick, edit the c:\autoexec.bat file.


Todd Vargo

unread,
Jul 26, 2002, 9:49:26 PM7/26/02
to

"pcmdc" <pc...@bigfoot.com> wrote in message
news:gjc09.18717$ND5.2...@e3500-atl2.usenetserver.com...

The problem is...

You used a colon for the separator.

PATH C:\BATCH:%PATH%

should be PATH C:\BATCH;%PATH%


To explain this problem better...

Since DOS allows setting nonexistent or invalid paths, in effect, the first
pointer in %path% was severed by using the colon as your separator.

If say, path contained,

c:\windows;c:\windows\command

then it would have become,

c:\batch:c:\windows;c:\windows\command

so "c:\windows" is now "c:\batch:c:\windows" which is invalid.

If you want this to be a permanent setting, as others have mentioned, place
the correct command in your autoexec.bat file.

--
Todd Vargo (body of message must contain my name to reply by email)

0 new messages