From: millin on
Hi,

I have a batch script like this,it works fine If I run it's own.

%sivadate%(user defined environment variable)
D:
CD D:\test\clips(where the makeDirZip.exe is located)
makeDirZip.exe i="\\<mserver>\c$\cdc\%sivadate%" debug='no' purge='no'

but if I call this batch script in a SQL job it didn't work,it gives me an
error..

Executed as user: <domain>\nlaservice. C:\WINDOWS\system32>D: D:\>CD
D:\Batch\eClipswebZip\ D:\Batch\eClipswebZip>makeDirZip.exe
i="\\uknlavwebt02\c$\cdc\" debug='no' purge='no' No input dir specified
i='input path' purge='yes|no' debug='yes|no'. Process Exit Code 0. The
step succeeded.

by looking at the SQL job log,I can see that the environment variable which
I have created "%sivadate%" is not passing as an argument.

From: John Bell on
On Wed, 19 May 2010 04:34:01 -0700, millin
<ssuj(a)discussions.microsoft.com(No Spam)> wrote:

>Hi,
>
>I have a batch script like this,it works fine If I run it's own.
>
>%sivadate%(user defined environment variable)
>D:
>CD D:\test\clips(where the makeDirZip.exe is located)
>makeDirZip.exe i="\\<mserver>\c$\cdc\%sivadate%" debug='no' purge='no'
>
>but if I call this batch script in a SQL job it didn't work,it gives me an
>error..
>
>Executed as user: <domain>\nlaservice. C:\WINDOWS\system32>D: D:\>CD
>D:\Batch\eClipswebZip\ D:\Batch\eClipswebZip>makeDirZip.exe
>i="\\uknlavwebt02\c$\cdc\" debug='no' purge='no' No input dir specified
>i='input path' purge='yes|no' debug='yes|no'. Process Exit Code 0. The
>step succeeded.
>
>by looking at the SQL job log,I can see that the environment variable which
>I have created "%sivadate%" is not passing as an argument.

Hi

I am not sure what %sivadate%(user defined environment variable) is
supposed to do.

Have you tried echoing the value into a file?

If you put this into a batch file then the variable could be passed as
a parameter when you execute the batch, then you wouldn't need to rely
on environment variables being set.

John