Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Not Found

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hey guys,

I have this code (BTW i have enabled xp_cmdshell):

Code:
CREATE TABLE #Files
(
[FileName]   VARCHAR(256) NULL
)

INSERT INTO #Files([FileName]) EXEC xp_cmdshell 'dir /A-D /B c:\qr'

SELECT * FROM #Files

drop table #files

and all i get back is:

File Not Found

however if i run dir /A-D /B c:\qr from cmdprompt i get a load of results.

I am running sql server 2008 r2 std with sp1.

Thanks

Dan

----------------------------------------

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
sorry - doh. Solved it.

Perms on the folder had gone a little odd. Sorted.

sorry

Dan

----------------------------------------

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top