xp_cmdshell
From: warren (warren2600_at_yahoo.com)
Date: 07/06/04
- Next message: Anith Sen: "Re: Please help with the SELECT statement."
- Previous message: Big E: "SQL Parameter"
- Next in thread: Steve Kass: "Re: xp_cmdshell"
- Reply: Steve Kass: "Re: xp_cmdshell"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Jul 2004 15:13:51 -0700
i'm trying to capture a key value and place it in a table.
I can get the value in a script, but would just like to
execute xp_cmdshell using the code and capture the output
to a table.
what am i missing?
i keep getting ...
output
NULL
here is my code: (just put my script in xp_cmdshell)
exec master..xp_cmdshell
'@echo off
set regvaluedata=
set regkey="\\server22\HKlm\software\key\key\key"
set regvalue="server"
:: line above for command (line might wrap)
for /f "Skip=4 Tokens=3" %%a in (''REG.EXE QUERY %
regkey% /v %regvalue%'') do set regvaluedata=%%a
:: line under for command
echo %regvaluedata%'
thanks in advance,
warren
- Next message: Anith Sen: "Re: Please help with the SELECT statement."
- Previous message: Big E: "SQL Parameter"
- Next in thread: Steve Kass: "Re: xp_cmdshell"
- Reply: Steve Kass: "Re: xp_cmdshell"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|