xp_cmdshell

Hi,
I have a batch file with three lines as given below:
Echo off
cd C: empIncomingFilesBOKDecrypted2009-11110209
rar.exe a C: empIncomingFilesBOKArchiveDecrypted20092009-11110209.rar
This file gets executed fine from command prompt.
But it fails when executed from query analyzer. The code iseclare @RtnValue int
Exec
@RtnValue = xp_cmdshell 'C: empIncomingFilesInputFilesArchive.bat'Select @RtnValue
The reason is "rar.exe' is not recognized as an internal or external command,"The environment variable "PATH"
is set with value "Crogram FilesWinRAR"
Any suggestions to make this work.
Thanks,
Gopal

The batch file is probably in the server.When you execute it from the terminal - the system searches rar.exe in your computer,and when you execute it using xp_cmdshell - the system searches it in the server.Is this the problem?