HELLO,
I am trying to run a batch file from xp_cmdshell.
It is being run in batch file which uses user created environment variables(user and system variables) and xp_cmdshell does not recognize those environment variable...
In sql client, if i give EXEC xp_cmdshell 'echo %PATH%'
Then it properly displays the content of path variable.
However, i create a env variable, say TEST and assign value as C:\Test and try to execute in xp_cmdshell
EXEC xp_cmdshell 'echo %TEST%'
Output is %TEST%
NULL.
As suggested in forums, I have also restarted the sql server service. Still it is not working.
Any suggestions are appreciated.
Thanks,
Amn