Error "The syntax of the command is incorrect" when renaming a file

I get this error on this step of my SQL 2005 process:

rename "G:\AuthorsList\AuthorsList_New.mdb""G:\AuthorsList\AuthorsListCopy.mdb"

I am trying to rename the file. I have also tried this and get the same error:

rename "G:\AuthorsList\AuthorsList_New.mdb" "G:\AuthorsList\AuthorsListCopy.mdb"

How do I resolve this error?

Answers


Check the documentation for the rename command:

Syntax rename [Drive:][Path]filename1 filename2

Parameters [Drive:][Path]filename1: Specifies the location and name of the file or set of files you want to rename. FileName1 can include wildcard characters (* and ?). filename2: Specifies the new name for the file. You can use wildcard characters to specify new names for multiple files.

The second parameter cannot be a path, it should contain only the new filename:

rename "G:\AuthorsList\AuthorsList_New.mdb" AuthorsListCopy.mdb

Need Your Help

Where and how to show ajax loading picture

javascript ajax jsp struts2

In left menu bar i am having two links about and messages while clicking on messages it is fetching user message page from server it is working properly.

C++ encrypting ascii value printing return key from array

c++ arrays loops casting ascii

I have this function. And its goal is to take the last character first of an array, uppercase the character if it is a letter. If it is a return key (ASCII value 10 ) or blank line, print that out ...