Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mamatha
Posting Yak Master
102 Posts |
Posted - 2005-01-06 : 01:54:28
|
HiI want to search for a particular folder in localdisk,actually i don;t know where it is localted.But i want to display files in that folder.How can i do this,is there any related code,i did some functionality but some times its giving errors,means it not getting the correct path.Please give me the solution,it very urgent for me. Dim objFSO , objDrive , drive'create an instance of FileSystemObjectSet objFSO = Server.CreateObject("Scripting.FileSystemObject")'Set objDrive = objFSO.DrivesFor Each drive in objFSO.Drivesif not drive="A:" thenSet objFolder = objFSO.GetFolder(drive&"\")'Response.Write(drive)for each folder in objFolder.subfolders for each folder_main in folder.subfolders for each folder_sub in folder_main.subfolders if folder_sub.name = "MSSQL" then Response.Write(folder_sub) exit for end if next nextnextend ifnextMamatha |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-01-19 : 06:39:01
|
Try thiscreate table #t (Message nvarchar(1000))insert #tEXEC master..xp_cmdshell 'dir c:\test'select * from #tif len((select * from #t where message='File not Found'))> 0 Print 'Folder Not Found'elsePrint 'Folder Found'drop table #t Madhivanan |
|
|
|
|
|