CVS commands through sql server xp_cmdshell

  • How do I run CVS commands through sql server xp_cmdshell. If I run eg. xp_cmdshell 'cvs -d :pserver:xxxx@xxx.xxx.xxx.xxx:/usr/local/cvsroot login' is not giving result. I run this command and wait for 10 minutes I have not got any answer so I stopped. How do I run this.

  • I am not familliar with cvs, but there might be a couple of things you can check.

    1. Does the command 'cvs -d :pserver:xxxx@xxx.xxx.xxx.xxx:/usr/local/cvsroot login' run ok from a command prompt?

    2. Do you need to be in a special directory to issue this command?  xp_cmdshell runs in \Windows\System32 on my machine.   ie if you run xp_cmdshell 'dir' you get the contents of the system32 directory.  if you issue the command xp_cmdshell 'pushd C:\ && dir && popd' you get the contents of the c:\ directory.  You might need to string a couple of commands together to issue the cvs command, or like ftp you might have to create a script to issue the commands for the cvs session and then run the script from xp_cmdshell.

    3. Do you need to be logged in as a particular user to issue this command?  You might check the account context in which the xp_cmdshell is running to ensure it has permissions to issue the cvs command.

    4. IF you need a persistent connection through the cmd shell, xp_cmdshell does not provide persistence between executions. ie If I were going to issue a series of ftp commands, I would need to create the ftp script and then issue a series of commands with the && symbol to run the ftp script.  I could not use xp_cmdshell 'ftp [port]' and then expect to use xp_cmdshell again to issue the logon information.

    Hope this helps.

    Steve

  • Hi Steve,

    Thanks for your kind answer. My CVS.exe is in PATH. So, I could able to run CVS --help through xp_cmdshell. But, If I run any other commands like login, execution is going to infinite. Even I could not able to stop cvs from process list.

    Please give any clue if you have.

    Thanks

    Sreedhar

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply