November 13, 2008 at 12:31 am
when i delete all files including subfolders from perticuler folder like following througt SQL Command..
exec xp_cmdshell 'del "c:\windows\temp\*.*"'
when i run this command, i got output whcih is below and ask for prompt [Y/N]
c:\windows\temp\*.*, Are you sure (Y/N)?
NULL
SO, how i can delete files from perticular folder including subfolders, is there any way..?
November 13, 2008 at 12:37 am
Add the /Q switch to the del command. It puts delete into silent mode so it won't prompt.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 13, 2008 at 12:40 am
November 13, 2008 at 10:02 pm
I am able to delete all files but not able to delete subfolders,
is there any option?
November 14, 2008 at 5:30 am
Add /S to the command line as well. Just be careful to run it in the intended directory! I once wiped almost my entire harddrive because I inadvertently ran it from C:
Regards,
Jan
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply