set PATH and RAYPATH in the batch file - WINDOWS 8.1

Dear experts,

I have already set in the environment variables of *WINDOW 8.1* the path
and raypath for Radiance. However, I would like also to set PATH and
RAYPATH straight in a batch file for a question of Radiance version
required by our tool.

Below what I have written in the *.bat file:

*set RAYPATH=.;C:\Radiance\lib;$RAYPATH*

*set PATH=.;C:\Radiance\bin\;$PATH*

*c:*

*cd /d %~dp0*

*gendaylit 1 3 9 -L 0 2500 -a 44.4167 -o -8.85 -m 15 -i 60 | genskyvec.pl
<http://genskyvec.pl> -m 4 -c 1 1 1 > temp/skysun.skv*

and this is the error that I got:

print() on closed filehandle OCONV at C:\Radiance\bin\genskyvec.pl line
114, <>line 18.

print() on closed filehandle OCONV at C:\Radiance\bin\genskyvec.pl line
115, <>line 18.

print() on closed filehandle OCONV at C:\Radiance\bin\genskyvec.pl line
116, <>line 18.

Use of uninitialized value in split at C:\Radiance\bin\genskyvec.pl line
137, <> line 18.

Use of uninitialized value $ang[0] in addition (+) at C:\Radiance\bin\
genskyvec.pl line 138, <> line 18.

Use of uninitialized value in split at C:\Radiance\bin\genskyvec.pl line
137, <> line 18.

Use of uninitialized value $ang[1] in addition (+) at C:\Radiance\bin\
genskyvec.pl line 138, <> line 18.

Use of uninitialized value in split at C:\Radiance\bin\genskyvec.pl line
137, <> line 18.

Use of uninitialized value $ang[2] in addition (+) at C:\Radiance\bin\
genskyvec.pl line 138, <> line 18.

Use of uninitialized value $ang[0] in addition (+) at C:\Radiance\bin\
genskyvec.pl line 141, <> line 18.

Use of uninitialized value $dom[0] in division (/) at C:\Radiance\bin\
genskyvec.pl line 141, <> line 18.

Illegal division by zero at C:\Radiance\bin\genskyvec.pl line 141, <> line
18.

Of course, if I run the batch file only with:

*cd /d %~dp0*

*gendaylit 1 3 9 -L 0 2500 -a 44.4167 -o -8.85 -m 15 -i 60 | genskyvec.pl
<http://genskyvec.pl> -m 4 -c 1 1 1 > temp/skysun.skv*

all works fine.

I have also noticed that Radiance's commands that do not require the perl
intrepreter run without problems with the path and raypath set in the batch
file.

Any advice?

Cheers,
*Giuseppe De Michele*