xp_cmdshell how to place folders that have space?

Asked

Viewed 129 times

0

I put a folder in the terminal

exec xp_cmdshell 'dir b:\teste\*xlsx*'
exec xp_cmdshell 'dir b:\teste teste\*xlsx*'

When I add the space it does not find. It is impossible to change the name of all folders that have space pq has several to find the way to where I want all the files, how can I make it identify those folders that contain the space character without giving error?

1 answer

1


Just add double quotes at the beginning and at the end of the road:

exec xp_cmdshell 'dir "b:\teste teste\"'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.