Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 810
user2821300 Avatar asked Nov 20 '13 19:11

user2821300


People also ask

What is the syntax of rename command?

RENAME (REN) RENAME changes the name of the first filename you enter to the second filename you enter. If you enter a path designation for the first filename, the renamed file will be stored on that same path.

How do I rename a file in command prompt?

To use mv to rename a file type mv , a space, the name of the file, a space, and the new name you wish the file to have. Then press Enter. You can use ls to check the file has been renamed.

What does the syntax of this command mean?

In the computer world, the syntax of a command refers to the rules in which the command must be run in order for a piece of software to understand it. For example, a command's syntax may dictate case-sensitivity and what kinds of options are available that make the command operate in different ways.


1 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
like image 139
Marek Grzenkowicz Avatar answered Oct 13 '22 23:10

Marek Grzenkowicz