• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2064
  • Last Modified:

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?

1 Solution
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!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now