xp_cmdshell & ss.exe(VSS). Error

  • Running SQL2005,sp2 on WinXP

    C:> ss.exe checkout abc.sql --WORKS

    xp_cmdshell 'ss.exe checkout abc.sql' --ERROR

    'No VSS database (srcsafe.ini) found. Use the SSDIR environment variable or run netsetup'

    (Initially, ss.exe gave this error from cmd prompt, but i set SSDIR, and it worked)

    Other commands seem to work.

    xp_cmdshell 'dir'

    works as expected - prints my c:\windows\system32 contents

    thanks

  • Is the srcsafe.ini file a per user thing or is there only one? I ask because of the context in which xp_cmdshell executes (i.e. using the SQL Server service account). If ss.exe is looking for the ini file in something like "My Documents", the physical location will vary from user to user.

    Of course, it would seem that the environment variable should fix this. Have you tried running xp_cmdshell 'set' to verify that the environment variable is visible to the xp_cmdshell session?



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • srcsafe.ini is a (single) VSS configuration file that exists on the VSS server.

    Env. variable SSDIR (on local machine) should be set to that directory

    (Ex: C:> set SSDIR ="\\Central\vss\")

    I didn't create a srcsafe.ini on my system - ss worked without it

    (maybe the file exists somewhere & ss automatically looks for it in MyDocuments etc.. - but i don't know where)

    Yes, I tried xp_cmdshell 'set' - it lists the SSDIR variable.

    I have a sql2005 server instance on my machine. I connect to it using management studio and run xp_cmdshell in that.

    (Are there any settings to be changed on this server instance ?)

    Note: I read that xp_cmdshell runs in a different session each time

    (

    xp_cmdshell 'dir' -- prints ..\system32

    xp_cmdshell 'cd c:\program files'

    xp_cmdshell 'dir' -- still prints ..\system32)

    So I tried:

    xp_cmdshell 'set SSDIR="\\central\vss\" & ss.exe checkout abc.sql'

    Still gave same ERROR.

    Thanks

  • So what account is the SQL Server service running with? And does that account have any rights to the network folder (hint - if it is running as Local System, probably not, unless you have a really poor security setup).

    Fix - change the SQL Server service account (use configuration manager). You can either use a domain account or Network Service. If you use Network Service, the SQL Server's domain machine account (domain\machinename$) will need rights to the network folder. Or you can try creating a local account on each machine, same name & password.



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • Sweet..

    It was running as local system. Changed it to 'This account' giving my windows username/pw - because i can directly access '\\Central\vss'

    (although it didn't work when i used Built-in-account:Network service)

    thanks

  • No problem. Although it would be best to use a dedicated service account, no password expiry (set a really long, complex password).



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


Viewing 6 posts - 1 through 5 (of 5 total)

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