WinRAR & xp_cmdshell

I'm having difficulty getting the following code to execute:

exec master..xp_cmdshell '"c:\program files\winrar\winrar.exe" x -o+ "\\fs1\myshare\*.zip" "\\fs1\myshare\"'

I'm getting the error msg "'c:\program' is not recognized as an internal or external command, operable program or batch file.

Any suggestions?

Who is Participating?
Aneesh RetnakaranDatabase AdministratorCommented:
exec master..xp_cmdshell '"c:\program~1\winrar\winrar.exe" x -o+ "\\fs1\myshare\*.zip" "\\fs1\myshare\"'
hennessymAuthor Commented:
Thanks - that worked once I changed program~1 to progra~1, but WinRar seemed to hang, so I just created a scheduled task to unzip the files and avoid xp_cmdshell entirely.

Because you did answer the question I asked, however, I'm still awarding you points.

Thanks again for such a quick response!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.