Link to home
Start Free TrialLog in
Avatar of wordtool
wordtool

asked on

xp_cmdshell space

I'm trying to something like the following:

Declare @myCommand varchar(255)
Set @myCommand = 'copy F:\Folder\SubFolder\file.txt  F:\Folder\SubFolder\my archive\file.txt'
EXEC xp_cmdshell @myCommand

I get an error "The syntax of the command is incorrect."

I believe this is due to the space in "my archive".  What am i doing wrong?  If it is the space, how do handle the syntax?
ASKER CERTIFIED SOLUTION
Avatar of BlackTigerX
BlackTigerX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wordtool
wordtool

ASKER

Yes, the quotes work, thank you.