You are here: how to copy files using xp_cmdshell « MsSQL Server « IT news, forums, messages
how to copy files using xp_cmdshell

Posted by SJM on 11/18/07 09:57

Howdy, hope someone can help me out with this.
I want to run a job each night that copies files from one server to another.
I cant even get a simple copy one file from one directory to another,
statement to work.
When I try :

@cmd 'copy c:\temp\file1.txt c:\backups\file1.txt'
master.dbo.xp_cmdshell @cmd

I get the msg: 'c' is not recognised as an internal command, program or
batch file, Null.

What I ideally want to do is pass xp_cmdshell variables for the 2 file's
path+names. I have tried numerous variations of single and double quotes
without success, which is why I decided to work up form the simple 'copy
c:\temp\file1.txt c:\backups\file1.txt', but can't even get that to work.
Any advice much appreciated.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация