all groups > sql server programming > october 2007 >
You're in the

sql server programming

group:

How to create a directory under C:\Program Files


How to create a directory under C:\Program Files huohaodian NO[at]SPAM gmail.com
10/27/2007 2:07:45 PM
sql server programming: Hi,

I am trying to create a directory under C:\Program Files\mydirectory
by using exec master.dbo.xp_cmdshell 'md C:\Program Files
\mydirectory', but get error says "A subdirectory or file C:\Program
already exists", even mydirectory is not there yet, I guess it because
of the space between Program and Files, any ideas how to overcome it?


Thanks in advance.
Re: How to create a directory under C:\Program Files Dan Guzman
10/27/2007 4:15:56 PM
[quoted text, click to view]

Try enclosing the path in double quotes:

EXEC master..xp_cmdshell 'MKDIR "C:\Program Files\MyDirectory"'


--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]
Re: How to create a directory under C:\Program Files huohaodian NO[at]SPAM gmail.com
10/27/2007 5:30:21 PM
On Oct 27, 5:15 pm, "Dan Guzman" <guzma...@nospam-
[quoted text, click to view]

Thanks, it solved problem.
AddThis Social Bookmark Button