hi!
I'm usng SQL server and i want to rename a file using the xp_cmdshell.
here's my code:
declare @path varchar (20)
declare @filename varchar (20)
declare @new varchar (20)
declare @cmd varchar (20)
set @path = 'E:\folder1\fol der2\folder3\'
set @filename = @path+'filename .txt'
set @new = 'newfilename.tx t'
set @cmd = 'REN '+@filename+' '+@new
exec master..xp_cmds hell @cmd
---
after running, i get this error:
The syntax of the command is incorrect.
Need technical help. please advise asap.
thnx again.
I'm usng SQL server and i want to rename a file using the xp_cmdshell.
here's my code:
declare @path varchar (20)
declare @filename varchar (20)
declare @new varchar (20)
declare @cmd varchar (20)
set @path = 'E:\folder1\fol der2\folder3\'
set @filename = @path+'filename .txt'
set @new = 'newfilename.tx t'
set @cmd = 'REN '+@filename+' '+@new
exec master..xp_cmds hell @cmd
---
after running, i get this error:
The syntax of the command is incorrect.
Need technical help. please advise asap.
thnx again.
Comment