Batch files acting erratically?

  • Thread starter Thread starter Ross
  • Start date Start date
R

Ross

Guest
If I go into the command prompt and type "defrag C:" (without quotes)
everything works fine.

However, if I run that exact same command from a batch file the command
constantly repeats itself over and over like it's stuck in some kind of loop.

If I write start defrag c: then about 250 cmd windows open and do nothing.

I've checked DOSKEY /macros and they are empty (as they should be)

Although it doesn't seem like a big deal it has me rather agitated.

Anybody have any idea what is going on? Any help would be much appreciated.
 
Re: Batch files acting erratically?

=?Utf-8?B?Um9zcw==?= <Ross@discussions.microsoft.com> wrote in
news:C1422BF7-CD50-4BB4-8ECC-C6BE72CCA995@microsoft.com:

> If I go into the command prompt and type "defrag C:" (without quotes)
> everything works fine.
>
> However, if I run that exact same command from a batch file the
> command constantly repeats itself over and over like it's stuck in
> some kind of loop.
>
> If I write start defrag c: then about 250 cmd windows open and do
> nothing.
>
> I've checked DOSKEY /macros and they are empty (as they should be)
>
> Although it doesn't seem like a big deal it has me rather agitated.
>
> Anybody have any idea what is going on? Any help would be much
> appreciated.


alt.msdos.batch.nt might be able to help, if no one here can.
 
RE: Batch files acting erratically?

Not sureif it's relevant but I just recently put together a new PC and it's
this new PC that I'm experiencing these irregularities on. =(

Here are the specs;
- Intel Core2 Quad 2.67ghz 12mb cache.
- XFX 790i Ultra Motherboard.
- XFX NVIDIA GeForce 9600 GT (PCI Ex).
- 2GB of cheap Patriot ram.

Using Windows XP Professional SP2 slipstream. (XP Pro wouldn't install until
I made an SP2 slipstream from the origional disk.)
 
Re: Batch files acting erratically?


"Ross" <Ross@discussions.microsoft.com> wrote in message
news:C1422BF7-CD50-4BB4-8ECC-C6BE72CCA995@microsoft.com...
> If I go into the command prompt and type "defrag C:" (without quotes)
> everything works fine.
>
> However, if I run that exact same command from a batch file the command
> constantly repeats itself over and over like it's stuck in some kind of
> loop.
>
> If I write start defrag c: then about 250 cmd windows open and do nothing.
>
> I've checked DOSKEY /macros and they are empty (as they should be)
>
> Although it doesn't seem like a big deal it has me rather agitated.
>
> Anybody have any idea what is going on? Any help would be much
> appreciated.


Not eratic at all - this is most likely because you called your
batch file "defrag.bat". This is a bad idea - never use existing
file or command names for a batch file!
 
Re: Batch files acting erratically?

You're exactly correct!

I can't believe I did that and it never even occurred to me.

Renamed it from defrag.cmd to test.cmd and it worked just fine. I'm very
relieved. Two thumbs up for you Pegasus.

"Pegasus (MVP)" wrote:

>
> "Ross" <Ross@discussions.microsoft.com> wrote in message
> news:C1422BF7-CD50-4BB4-8ECC-C6BE72CCA995@microsoft.com...
> > If I go into the command prompt and type "defrag C:" (without quotes)
> > everything works fine.
> >
> > However, if I run that exact same command from a batch file the command
> > constantly repeats itself over and over like it's stuck in some kind of
> > loop.
> >
> > If I write start defrag c: then about 250 cmd windows open and do nothing.
> >
> > I've checked DOSKEY /macros and they are empty (as they should be)
> >
> > Although it doesn't seem like a big deal it has me rather agitated.
> >
> > Anybody have any idea what is going on? Any help would be much
> > appreciated.

>
> Not eratic at all - this is most likely because you called your
> batch file "defrag.bat". This is a bad idea - never use existing
> file or command names for a batch file!
>
>
>
 
Re: Batch files acting erratically?

Thanks for the feedback.

"Ross" <Ross@discussions.microsoft.com> wrote in message
news:94B6A0C6-6685-4A3B-82BD-1EFF49922B01@microsoft.com...
> You're exactly correct!
>
> I can't believe I did that and it never even occurred to me.
>
> Renamed it from defrag.cmd to test.cmd and it worked just fine. I'm very
> relieved. Two thumbs up for you Pegasus.
>
 
Back
Top