all groups > sql server replication > july 2007 >
You're in the

sql server replication

group:

Cannot run snapshot agent from command line


RE: Cannot run snapshot agent from command line Paul Ibison
7/10/2007 8:58:04 AM
sql server replication:
Can you create your command as text in a batch file then use RunAs (or log on
again if RunAs is disabled). The user to select is the sql server agent
login...
HTH,
Paul Ibison
Cannot run snapshot agent from command line acsnaterse
7/10/2007 2:58:26 PM
I have a transactional replication running and it's running well.

But now i'm writing a script so I can start the Snapshot Agent from
distance. therefore I want to run it from the command prompt.

I'm using this command: C:\Program Files\Microsoft SQL Server\80\COM
\snapshot.exe -Publisher <server> -PublisherDB <pubDB> -Publication
<pub> -DistributorLogin <login> -DistributorPassword <pwd>

And this is my output:
==== Output start ======
Microsoft SQL Server Snapshot Agent 8.00.2039
Copyright (c) 2000 Microsoft Corporation

The process could not create file '\\<server>\ReplData\unc'.

Finished with exit code 2
==== Output end ======

When I start the agent from SQL Server itself it works fine.

the location of the snapshot folder is defined as '\\<server>
\ReplData' and (for testing now) this folder has full access.

Can somebody tell mee what;s going wrong and what I can do about it?
Re: Cannot run snapshot agent from command line Hilary Cotter
7/11/2007 12:00:00 AM
You need to check to ensure that the share permissions are full for the
account which the SQL Server Agent runs under, or the account the snapshot
agent is proxied under, and the underlying security is full for the path and
all child objects.

--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Re: Cannot run snapshot agent from command line acsnaterse
7/26/2007 7:09:28 AM
[quoted text, click to view]

Hi,

Thanks! With the runas commando it works great!

Hint: in combination with Sanur (http://www.commandline.co.uk/
sanur_unsupported/index3.html) you can automate the password fill-in.
AddThis Social Bookmark Button