|
Re: mkdir creates file instead of directory ...
Hello -
The batch file is called INSTALL.XXX.bat and not mkdir.bat.
I will try the md ... what is the difference? Is the || always
equivalent to if not %errorlevel% == 0?
Thanks a lot!
Joe
On Jul 10, 3:45*pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "Joe HM" <unixve...@yahoo.com> wrote in message
>
> news:4cc459f1-193c-4818-8bb5-c092ed7dbd5c@b1g2000hsg.googlegroups.com...
>
>
>
>
>
> > Hello -
>
> > I have this strange intermittent problem where a mkdir command in a
> > batch file will create a file with the name of a directory instead of
> > the directory itself. *This has happened for several people and I have
> > no clue what is causing it.
>
> > Here is the code ...
>
> > if not exist "C:\Program Files\X" mkdir "C:\Program Files\X"
> > if not %ERRORLEVEL% == 0 goto error
> > if not exist "C:\Program Files\X\Y" mkdir "C:\Program Files\X\Y"
> > if not %ERRORLEVEL% == 0 goto error
>
> > Could this be because I am creating two directories or is this a bug
> > with mkdir?
>
> > I/we have XP SP2.
>
> > Thanks,
> > Joe
>
> The probability of there being a bug with mkdir is extremely small.
> It is far more likely that you created a file called "mkdir.bat", which
> is not a good idea. What happens if you replace the command
> "mkdir" with its alias "md"?
>
> By the way, you could tighten your code like so:
> if not exist "C:\Program Files\X" md "C:\Program Files\X" || goto error
> if not exist "C:\Program Files\X\Y" md "C:\Program Files\X\Y" || goto error- Hide quoted text -
>
> - Show quoted text -
|