I am new to xcopy. I am trying to move a file that is in excel format to a new destination and as a csv file. I have to do this so that the DMExpress ETL job can move the file and then read it. This is how my company wants it done.
So this is what I have so far:
xcopy "\blah\blah\blah\blah*.xlsx" "\blah\blah\blah\blah\Badge.csv" /Y <f.txt> create_copy_script.log
Not sure why I have to have the <f.txt>, if someone could explain that, that would be great. But that is a secondary question.
When I run this in a .bat file, and then open the file (which does move and does change its name), I get the following error:
The file format and extension of "Badge.csv" don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?
Now, the next part of the ETL has to open this file and load the data into a database table.
To be able to do this right now, I have to open this file, resave it as a csv file and then the second part of the ETL works perfectly. But I want automation. I cant open this file on the weekends, that is dumb.
So, I am assuming I am doing something wrong with my script. Should the move and rename be separate? is there a better way? Maybe I can't just rename the file and extension, if I cannot what is the better way to do that?
Note: I need to keep the original file in its original folder and make a copy of it instead and move that, which is why I am using xcopy.